Open Source Software
Ubuntu is a widely used Linux distribution

Upgrading from Ubuntu 14.04 to 16.04

After putting it off as long as possible, I finally bit the bullet and upgraded from Ubuntu 14.04 to 16.04; there were just too many things where I needed the newer software levels in 16.04. Fortunately, this upgrade went quite smoothly unlike my experience moving from 12.04 to 14.04. The article that follows is a discussion of the upgrade steps specific to 14.04 to 16.04, but this is also probably useful for any upgrade.

One useful step that I did not do but highly recommend is deleted old Linux kernel images, as this would have cut hours off of the upgrade process.

Backup

There are a variety of ways to back up a system. I use the following to maintain multiple copies of files:

  • Clonezilla for disk-level backups.
  • Duplicity for both local and off-site backups.
  • Subversion for code. While this is not truly a backup, it provides an easy way to copy the current version of my files.
  • Box, OwnCloud and other cloud services.

Updating

Before upgrading, I made sure that all of my installations were up to date:

sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get autoremove

After the last of these, I rebooted.

Remove Old Kernel Images

I did not do this and wish I had. My installation had a lot of old kernel images which caused some of the updates steps to run really long, as in n squared where n is the number of kernel images. It took hours. “How do I remove od kernel versions to clean the boot menu?” provides great information on cleaning up old kernel images. To remove old images, first use

sudo apt-get autoremove

to get rid of obsolete stuff. Next, use

uname -r

to find out the image that you are using now. Make sure not to delete this one and probably the last two or three. Next list all of the kernel images with

dpkg --list | grep linux-image

Begin removing individual images with

sudo apt-get purge linux-image-x.x.x-x-generic

Remove multiple images with

sudo apt-get purge linux-image-3.2.2{1,3,4}generic

If your system started out on Ubuntu 12.04 or earlier and you need to remove an entire series, use

sudo apt-get purge linux-image-3.2*

This will take a while, especially if apt re-runs update-grub2 after each removal. When you are done, make sure to rebuild grub with

sudo update-grub2

Fix Python Problem

When I first tried to upgrade, I received a message about a corrupted Python installation, due to my use of the Ubuntu alternatives system for managing installations of multiple levels of a product. From How to fix “python installation is corrupted”? I found the following commands that worked fine.

sudo update-alternatives --remove-all python sudo ln -sf /usr/bin/python2.7 /usr/bin/python

Upgrading

The actual upgrade command is straightforward:

sudo do-release-upgrade

The time estimate for downloading files over a FIOS link was a little over an hour. While the download only took a couple of hours, the upgrade process took more than 12, though most of this was due to a large number of old kernel images. The update script processed each one and rebuilt the GRUB menu for each and every kernel image giving this step a complexity of n squared. This is why I recommend cleaning up old kernel images before running the upgrade.

Fix Networking Problem

On the reboot after the upgrade, my system would not connect to the Internet and the graphical display did not work reliably. To fix the networking problem, log in to the console and use the venerable vi character-based editor to create a /etc/network/interfaces.d/eth0 file for a static IP address:

iface eth0 inet static address 192.168.0.2 netmask 255.255.255.0 gateway 192.168.0.1 broadcast 192.168.0.255 dns-nameservers 192.168.0.1

Make sure to use the correct value or set up a DHCP connection:

auto eth0 iface eth0 inet dhcp

Resolving “Failed to start kernel modules” Message

The boot process showed this message. To investigate

journalctl | grep modules

This showed that “it87” was not loading:

Feb 14 12:22:50 localhost systemd-modules-load[354]: Inserted module 'lp' Feb 14 12:22:50 localhost systemd-modules-load[354]: Inserted module 'ppdev' Feb 14 12:22:50 localhost systemd-modules-load[354]: Inserted module 'parport_pc' Feb 14 12:22:51 localhost systemd-modules-load[354]: Inserted module 'nvidia_340' Feb 14 12:22:51 localhost systemd-modules-load[354]: Inserted module 'ds1621' Feb 14 12:22:51 localhost systemd-modules-load[354]: Failed to insert 'it87': Device or resource busy Feb 14 12:22:51 localhost systemd-modules-load[354]: Inserted module 'cuse' Feb 14 12:22:51 localhost systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE Feb 14 12:22:51 localhost systemd[1]: systemd-modules-load.service: Unit entered failed state. Feb 14 12:22:51 localhost systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'. Feb 14 12:22:54 localhost systemd-modules-load[856]: Inserted module 'nvidia_340' Feb 14 12:22:54 localhost systemd-modules-load[856]: Failed to insert 'it87': Device or resource busy Feb 14 12:22:54 localhost systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE Feb 14 12:22:54 localhost systemd[1]: systemd-modules-load.service: Unit entered failed state. Feb 14 12:22:54 localhost systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'. Feb 14 12:23:00 localhost vboxdrv[1247]: Starting VirtualBox kernel modules ...done. Feb 14 12:24:10 localhost gnome-session[3630]: Program Not Found: /usr/share/ncid/modules/ncid-kpopup Feb 14 12:24:13 localhost ureadahead[361]: ureadahead:./sugarcrm/roles_modules.ibd: Ignored relative path Feb 14 12:24:13 localhost ureadahead[361]: ureadahead:./suitecrm/roles_modules.ibd: Ignored relative path

This turns out to be a temperature sensor. lm sensors not returning CPU temp (it87) provides a good discussion on fixing this problem.

sudo apt-get install lm-sensors sudo sensors-detect

The sensors-detect program prompts to add the necessary lines to /etc/modules.

Update Plugins for Various Applications

Most browsers and email clients have a plugin architecture that runs outside of Ubuntu. Make sure to open all of the applications like this and update plugins.

Update Repository Definitions in /etc/apt/sources.list.d

During the upgrade process, all of the non-Ubuntu repositories that you may have defined in for apt were disabled. You now need to go back and point the to the “xenial” or 16.04 versions instead of the “precise” or 14.04 versions. This is probably something that you want to do one repository at a time, as there may be some repositories that you no longer need due to updated base software levels in 16.04. You may need to research and update keys for the new repository definitions using the apt-key add command.

When you have finished with each one, run

sudo apt-get update sudo apt-get upgrade

to upgrade the software from the new repositories.

Upgrade VirtualBox

If you have VirtualBox installed, you may want to upgrade to 5.0 or 5.2 depending upon what release you are using. Prior to upgrading, I experienced a number of resolution problems for a second monitor. Upgrading from 5.0 to 5.2 fixed the problems with no further work.

See the VirtualBox download page for instructions on adding the repositories and installing 5.2. If you already have 5.0 installed, it will uninstall 5.0 and install 5.2. Once you start VirtualBox, it will prompt for updating the VirtualBox Extensions of you have them installed.

You should also update the VirtualBox Guest Additions that are installed in each of the virtual machines that you have running.

We use cookies to ensure you get the best experience on our website.