Upgrading Ubuntu 10.04 Lucid to 12.04 Precise

This document will guide you through upgrading an Ubuntu 10.04 (Lucid) server to an Ubuntu 12.04 (Precise) server.

We highly recommend that you perform all of these steps on a test system before making changes to your production server -- that way, you can minimize downtime by knowing what to expect.

You should plan for some downtime -- there are big differences between the two distributions, and things don't always go as smoothly as we would hope.

Note that Ubuntu recommends waiting for the first dot release before performing an upgrade:

"Upgrades between LTS releases are not enabled by default until the first point release, 12.04.1, scheduled for July. It is recommended that most LTS users wait until then before upgrading to 12.04."

You can see the full release notes here (we'd recommend reading these before performing an upgrade):

https://wiki.ubuntu.com/PrecisePangolin/ReleaseNotes/UbuntuServer

For those wishing to upgrade, the following steps will guide you through the process --

Upgrade Guide

Backups

Make sure you have full backups of everything on your server that is important to you. At the very least, you should generate full backups of all your Virtual Servers. You may also want to make a backup of everything in /etc.

Package Updates

Make sure your system is fully up to date by running these commands:

sudo apt-get update
sudo apt-get upgrade

resolv.conf tweak

Make sure your resolv.conf file is not marked as immutable. That can be done with this command:

chattr -i /etc/resolv.conf

Reset Dependency Flags

These packages are already installed, but the following command will tell apt not include them anytime "apt-get autoremove" is run:

apt-get install bind9 spamassassin spamc procmail libnet-ssleay-perl libpg-perl libdbd-pg-perl libdbd-mysql-perl quota iptables openssl python mailman subversion ruby irb rdoc ri mysql-server mysql-client mysql-common postgresql postgresql-client awstats webalizer dovecot-common dovecot-imapd dovecot-pop3d proftpd webmin usermin webmin-virtual-server libcrypt-ssleay-perl webmin-virtual-server-theme webmin-virtualmin-dav webmin-virtualmin-svn webmin-virtualmin-awstats webmin-virtualmin-mailman webmin-virtualmin-htpasswd clamav-base clamav-daemon clamav clamav-data clamav-freshclam clamav-docs clamav-testfiles libapache2-mod-fcgid scponly apache2 apache2-doc libapache2-svn libsasl2-2 libsasl2-modules sasl2-bin usermin-virtual-server-theme procmail-wrapper php-pear php5 php5-cgi webmin-security-updates libgd2-xpm

Update Manager

Make sure you have the update manager core by running this command:

sudo apt-get install update-manager-core

Begin Upgrade

Run the following command to begin the upgrade process. Ubuntu suggests running this from the console, though it should also work from SSH:

do-release-upgrade -d

And then follow the on-screen instructions.

In general, if you are prompted about whether to replace a config file with a new one, or keep your existing one -- we would suggest keeping your existing config.

Coffee

Now is an excellent time to go get some coffee or another beverage of choice, while the packages are downloaded and installed :-)

Reboot

When the upgrade completes, it will prompt you to reboot your system. Perform the reboot, and when your system comes back online, there's just a few more things to change.

Change apt config

Edit /etc/apt/sources.list, and uncomment the Virtualmin repositories. Then change any references of "lucid" in those repositories to "precise".

Run this command, and make sure the new apt config works properly:

apt-get update

PHP Config

Edit /etc/apache2/mods-enabled/php5.conf, and comment out the lines that begin with SetHandler.

Then restart Apache:

/etc/init.d/apache2 restart

DNS Settings

Ubuntu 12.04 changes the way DNS setup is handled. Rather than adding nameservers to /etc/resolv.conf, they need to be added to /etc/network/interfaces.

Edit /etc/network/interfaces, look for your primary ethernet device (such as eth0), and add this line under your primary ethernet device:

dns-nameservers 127.0.0.1

And then restart your networking:

/etc/init.d/networking restart

Test

That's it for configuring your updated system. Now it's time to test your services and websites!

Notes

Dovecot

If you see these Dovecot errors:

Error: service(pop3-login): listen(::, 110) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(pop3-login): listen(::, 995) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(imap-login): listen(::, 143) failed: Address family not supported by protocol
Error: socket() failed: Address family not supported by protocol
Error: service(imap-login): listen(::, 993) failed: Address family not supported by protocol
Fatal: Failed to start listeners

That means that Dovecot is trying to listen on an IPv6 interface, but that doing so isn't supported on your server.

That can be solved by editing /etc/dovecot/dovecot.conf, and setting the following at the top of the file:

listen = *

Then restart Dovecot:

/etc/init.d/dovecot restart