WordPress has been fully installed and configured- Have root Priveleges
Go to your WP root Directory,
>> cd /var/www/wpsiteroot/Download the latest version:
>> sudo wget http://wordpress.org/latest.zipUnzip the latest version
>> sudo unzip latest.zipThis will have created a wordpress directory. Delete the latest.zip file
>> sudo rm latest.zipLet’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..Move the new wp-admin and wp-includes into the site directory:
>> sudo rm -r wp-admin wp-includes/
>> sudo mv wordpress/wp-admin wp-adminLet’s make a backup of wp-contents, just in case
>> sudo mv wordpress/wp-includes/ wp-includes
>> sudo cp -r wp-content wp-content-backupCopy 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:
Copy the rest of the loose files in wordpress to the site root directory:>> sudo rm -r wordpress/wp-content
Puma Latest version
>> 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,