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):
For those wishing to upgrade, the following steps will guide you through the process --
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.
Make sure your system is fully up to date by running these commands:
sudo apt-get update sudo apt-get upgrade
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
Make sure you have the update manager core by running this command:
sudo apt-get install update-manager-core
Run the following command to begin the upgrade process. Ubuntu suggests running this from the console, though it should also work from SSH:
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.
Now is an excellent time to go get some coffee or another beverage of choice, while the packages are downloaded and installed :-)
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:
Edit /etc/apache2/mods-enabled/php5.conf, and comment out the lines that begin with
Then restart Apache:
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.
/etc/network/interfaces, look for your primary ethernet device (such as eth0), and add this line under your primary ethernet device:
And then restart your networking:
That's it for configuring your updated system. Now it's time to test your services and websites!
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: