How to Update(Upgrade) Latest Wordpress Manually on Linux Server?


  1. WordPress has been fully installed and configured
  2. Have root Priveleges
Go to your WP root Directory, 
>> cd /var/www/wpsiteroot/
Download the latest version:
>> sudo wget http://wordpress.org/latest.zip
Unzip the latest version
>> sudo unzip latest.zip
This will have created a wordpress directory. Delete the latest.zip file
>> sudo rm latest.zip
Let’s take a look at the contents of the wordpress directory:
>> cd wordpress/>> lsindex.php             wp-cron.phplicense.txt           wp-includesreadme.html           wp-links-opml.phpwp-activate.php       wp-load.phpwp-admin              wp-login.phpwp-blog-header.php    wp-mail.phpwp-comments-post.php  wp-settings.phpwp-config.php         wp-signup.phpwp-config-sample.php  wp-trackback.phpwp-content            xmlrpc.php

Looks like the same as the actual wordpress directory.
Go back up to the site root and delete wp-admin and wp-includes
>> cd..
>> sudo rm -r wp-admin wp-includes/
 Move the new wp-admin and wp-includes into the site directory:
>> sudo mv wordpress/wp-admin wp-admin
>> sudo mv wordpress/wp-includes/ wp-includes
Let’s make a backup of wp-contents, just in case
>> sudo cp -r wp-content wp-content-backup 
Copy the contents of wp-contents into the old wp-contents:
>> sudo cp -rv wordpress/wp-content/* wp-content/ 
You might want to go through the directory and check that your old stuff is still there. Delete the wp-content that we copied from:
Puma Latest version
>> sudo rm -r wordpress/wp-content  
Copy the rest of the loose files in wordpress to the site root directory:
>> sudo mv wordpress/*  
Check that nothing is left in wordpress, then remove the empty directory:
>> ls wordpress/
>> sudo rm -r wordpress/ 
Decide what you want to do with wp-content-backup.

That's it, Now When you go on Wordpress, You will found that, your wordpress is updated successfully now update your database with click one button. Don't worry it will done without any problem, but if you don't want to take any risk, do one thing go on your server again through Terminal,