Upgrading Ubuntu 14.04 to 15.04 to 15.10

I was recently tasked with upgrading some Ubuntu 14.04 LTS servers to Ubuntu 15.10. I found out that this upgrade path is troublesome, it causes some problems that took me a while to figure out. Therefor, I decided to write this blog for future reference and hopefully to help other people facing the same problems as well.

Since Ubuntu 15.10 is not an LTS release, start out by changing the /etc/update-manager/release-upgrades file. (If you don’t have this file, install the update manager first by running sudo apt-get install update-manager update-manager-core)

In it, change the line:

Prompt=lts

To:

Prompt=normal

Now, save the file and run:

sudo do-release-upgrade

This will attempt to upgrade your installation to Ubuntu 15.04. But, this process quits with errors. Some packages will not be installed properly. To fix this, run:

sudo apt-get -f install

At this point, something is seriously wrong with your server. It is missing some important files in the /sbin directory. Stuff like init, reboot and shutdown are no longer available (seems to be caused by this bug). This causes the first problem, you can’t reboot your server to complete the upgrade (at least not cleanly and doing a forced reboot will cause a kernel panic, since init is gone (and yes, I found that out the hard way…)). In order to restore those, run:

sudo apt-get install systemd-sysv

Now, when this is finished your system is somewhat complete again and you can reboot normally:

sudo reboot

At this point, your server is at 15.04, but there still seems to be something wrong. In my case, the /etc/resolv.conf file was completely wiped, causing DNS resolution failures. To fix that, run:

sudo apt-get dist-upgrade

At this point, apt-get might complain that the packages cannot be verified (I’m not sure why, restoring resolv.conf did not help to fix this). Since I was upgrading a server that was just installed the other day, I decided to skip the verification and continue with the upgrade either way. But do so at your own risk. For production servers I’d suggest to try and fix this verification problem first (but I didn’t dig into that specific problem, so I can’t say how).

After doing the dist-upgrade your system should be stable again. Before we reboot, there is another problem that was just introduced to the system. For some reason, the kernel decides to boot in graphical mode. So, if you’re running Ubuntu on a server and don’t have any graphical interface, you won’t be presented with a login screen anymore (SSH still works though). If you already rebooted, you should be able to see the login prompt again by switching TTY with Alt + F1 or Alt + F2. To prevent the system from booting in graphical mode, you should make a slight alteration to the /etc/default/grub file (thanks to Bruno Pereira for his answer at askubuntu.com).

Find this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

And replace it with this:

GRUB_CMDLINE_LINUX_DEFAULT="text"

Save the file and update Grub by running:

sudo update-grub

Now you should be able to safely reboot the system.

sudo reboot

Now it’s time for the final step, upgrading 15.04 to 15.10. Luckily, this upgrade is a lot less painful. I didn’t encounter any problems when doing this upgrade. Simply run the updater once again:

sudo do-release-upgrade

In the end it should ask you if you want to restart your server. Answer with yes and wait for your server to boot up. Your system now finally runs on Ubuntu 15.10!