1. Create a full website backup! Make a copy of all your Magento installation files, and database, in case something goes wrong.
2. Login to the SSH using the user credentails of your Magento account
3. Follow the below commands:
cd ~/public_html/
touch maintenance.flag
chmod +x pear
chmod +x mage
chmod 750 mage
./pear mage-setup .
./pear upgrade -f magento-core/Mage_All_Latest-stable
./mage config-set preferred_state stable
./mage sync
./mage upgrade-all --force
php shell/indexer.php reindexall
rm -rf downloader/.cache/ var/cache/
./n98-magerun.phar cache:flush
rm -rf maintenance.flag
NB if you experience any problems or errors running "./mage upgrade-all --force", you may have luck with this command instead:
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force