Upgrading Ubuntu Server to lastest LTS version

From Adminbuntu, Everything for the Ubuntu Server Administrator

This is an excerpt from Adminbuntu, a site for Ubuntu Server administrators:

http://www.adminbuntu.com/upgrading_ubuntu_server_to_lastest_lts_version

If possible, don’t use SSH when upgrading a server. On Linode, you can use their Lish terminal, available from the virtual server’s console page.

This was tested while upgrading a 10.04 LTS Ubuntu Server to 12.04 LTS. The test server was a production web server with a large number of packages installed and configuration changes.

Back up the Server First

If your virtual hosting provider offers image backups, this is a good option. The important thing is knowing for certain that you can restore/recreate the server in case the upgraded server is not left in a bootable, usable condition.

Install the Upgrade Manager

sudo aptitude -y install update-manager-core

Double-check Configuration File

Run this command to check whether “/etc/update-manager/release-upgrades” has the line “Prompt=lts”.

[[ `grep Prompt=lts /etc/update-manager/release-upgrades` = 'Prompt=lts' ]] && echo '"/etc/update-manager/release-upgrades" is Ok' || echo 'Edit /etc/update-manager/release-upgrades and add line "Prompt=lts"'

If the line is not present edit “/etc/update-manager/release-upgrades” with:

sudo vi /etc/update-manager/release-upgrades

…and add the line:

Prompt=lts

Run the Upgrade Manger

sudo do-release-upgrade

Follow the on-screen instructions.

When this was tested on a production server:

  • The upgrade went smoothly.
  • When prompted for a new MySQL root password (sever times during the upgrade) Enter was pressed without entering a new password. The existing MySQL password was retained by the server with no issues.
  • When the upgrade manager encountered a configuration file with custom changes, the existing, modified configuration file was retained (not replaced with the distribution default configuration file). This worked well. The only change needed after upgrading was adding a new line to phpMyAdmin’s configuration file that was needed for the new phpMyAdmin version.
Be Sociable, Share!