Upgrade Ubuntu 12.04 to 14.04
Ubuntu 12.04 (“Precise Pangolin”) stopped receiving security updates from Ubuntu in April 2017. To continue receiving updates from Ubuntu, you must upgrade Ubuntu.
::: Operating system upgrades are risky. If the upgrade fails, your server will become unusable. It is often better to migrate your apps to a new server running the latest version of Ubuntu. :::
Preparing to Upgrade
Important: Take a server snapshot at your provider before upgrading.
If your server has 1GB of memory or less, you should increase the server’s memory before starting the upgrade or else the upgrade may fail. After the upgrade is complete, you can decrease the server’s memory.
Once you’ve taken a snapshot of your server and made sure it has enough
memory, SSH in to your server as root
and run
the following commands to make sure your server is ready to be upgraded
to a new version of Ubuntu.
sudo apt-get update && sudo apt-get dist-upgradesudo dpkg --configure -a
If any of the above commands fail or print error messages, do not proceed with upgrading to a newer Ubuntu version.
Next, run the following command to remove any conflicting apache2 packages in case you ever accidentally installed them while customizing your server:
sudo apt-get remove apache2 apache2-bin apache2-data
Performing the Upgrade
::: All of the apps on your server will be down during the upgrade. Depending on your server’s network connection and hardware, the upgrade may take anywhere from ten minutes to two hours. :::
To upgrade your Ubuntu 12.04 server to Ubuntu 14.04, SSH into your
server as root
and run the following command:
sudo do-release-upgrade -f DistUpgradeViewNonInteractive
If the upgrade completes without errors, take a new snapshot of your server so you’ll have a snapshot of the server after the upgrade.
If the upgrade fails or encounters any errors, restore your server to the snapshot you made before you began the upgrade.