Upgrading to Ubuntu 16.04 LTS from 14.04 LTS on a server running Koha Integrated Library System

So the new Ubuntu 16 Server OS is out, and perhaps you like new and shiny things (kinda like the “niffler”, that cross between a platypus and a mole in Fantastic Beasts and Where You Can Find Them).

But upgrading is not always the easiest, or indeed, the best thing to do. Unless your release is coming to its end-of-life (I was on Ubuntu 14.04 LTS, which still has another 2 years) , or you are running software that can’t update unless you upgrade, I’d recommend not rushing upgrades. If it ain’t broke, don’t fix it. And waiting allows others to go through the teething problems, and, just like I am doing, tell you about all their chaos, struggles and victories.

I needed to upgrade because to run the latest version of one my programs, they needed dependencies that are only available in Ubuntu 16. This tutorial is based on what I experienced as I was upgrading my development servers in preparation to do the same on my production servers.

That last line might have got you thinking – development server? Yep, I’ve found out (quite painfully) that it is always a good idea to test things out before you roll them out into a production environment. If something goes wrong, you can work out the kinks, otherwise all your important websites and programs will stop working, and I don’t need to explain the rest. I don’t think a development or testing server needs to be particularly fancy – a cheap desktop running the same server OS and same software as you have on your production server is sufficient. Trust me, it’s a investment.

Disclaimer: Yep, I have to say this. I’ve been using Linux long enough to know that catastrophes happen. So, don’t take this tutorial for gospel! I’m not responsible for anything that might go wrong. If, on the other hand, it all works great, then, that’s a different story…

The Server

Both my development and production servers had the following:

  • Ubuntu Server 14.04 LTS
  • Koha Integrated library system – which is the most important program that I’m running on my system. It’s an open source system. You can read about it here.

There are other programs, like apache, php etc., that are running on it as well.

Pre-upgrade Prep


That’s the most important thing you can do before an upgrade. There are lots of software that you can use to make backups of your entire system or particular programs. I used mysqldump to backup my databases and Rsync to backup important documents and folders. Another good one is Bacula.

The most important things to back up for me were:

  1. MySQL databases – I did a single dump of the entire database and then individual ones as well. Learn how to do so in this article
  2. Configuration files – all the custom configuration files, especially for backups, and those in /etc/ and /etc/apache and /var/www
  3. Documents – I don’t have a lot of these, but whatever I needed, I backed up.
  4. And just to be sure, I backed up the entire root directory ( / )

Your backups are likely going to take up space, so it’s a good idea to compress them. I recommend 7zip using ultra settings – you can read the instructions here.

Update and Upgrade

$ sudo apt-get update

Make sure your system is up-to-date by doing the following:

$ sudo apt-get upgrade

$ sudo apt-get dist-upgrade


Reboot your system to finish installing the updates

Upgrading to Ubuntu 16.04 LTS

Running the upgrade

If you don’t already have the update-manager-core package, then go ahead and install it

$ sudo apt-get install update-manager-core

Make sure the line “Prompt=lts” is present in the file /etc/update-manager/release-upgrades. If not, insert it after the last line of text in the file.

$ sudo nano –b –u /etc/update-manager/release-upgrades

Now you can start the upgrade

$ sudo do-release-upgrade

I encourage you to do this whilst directly connected to your system. If you are upgrading via SSH, a new port will open on 1022 just in case you lose connectivity and need to access SSH.

Enter “y” or “yes” when prompted if you want to continue with the upgrade.

Restarting Services

Some services will need to restart and a prompt will come up. Answering “yes” should be ok.

New vs. Old Configuration Files

In some cases, you will be asked whether you want to replace the old configuration files with the new ones. Read these prompts carefully, you will have to make a judgment call for each of them. If you don’t have custom configurations then “yes” should be ok, otherwise I recommend sticking with your old configuration. At least that’s what I did 🙂

Obsolete packages

When the new packages have finished installing, you will be asked whether or not you want to remove the obsolete packages. Be very careful here as well. If you have customized your system, read through carefully which programs will be removed. I didn’t and I got into quite a bit of trouble later. Note which packages you might need to re-install.

The upgrade will take quite a long time, even if you have a fast connection. So it needs patience. Grab a coffee. Or some roobois tea…


When everything is done, you will be asked to restart the system. Say yes and if all went well, you will be running Ubuntu 16.04 LTS Xernial Xerus!

Did you encounter problems? Did we miss anything out? Let us know below!