Home > Support > HOWTO List > Ubuntu: dist-upgrading between versions

Ubuntu: dist-upgraded Ubuntu

Ubuntu LTS releases tend to each have a good few years of security support.  But even Ubuntu distros eventually need to be dist-upgraded to the new releases.

This is reasonably straight forward with Ubuntu.  The issues that do crop up are typically standard (distro provided) config files that you have edited (you need to decide whose version to use).  And sometimes issues around webapps or custom software where that software does not work with the new software (e.g. newer PHP) on the new distros.

An automated dist-upgrade using our 'distrorejuve' tool.

There are a few steps to dist-upgrading an Ubuntu server.  We have automated those in our distrorejuve script on github.

To do an automated dist-upgrade:

Take a snapshot backup of your VM.

Will your non-package applications (e.g. your websites) work with the newer package versions that would be installed?  e.g. with a recent PHP version.  If not, and if the upgrade fails, you would need to restore to the backup you have just taken.

Restart your server with a new (5.10 or newer) kernel at our kernel page.

Download and run the distrorejuve script:


wget -O distrorejuve.sh --no-check-certificate https://raw.githubusercontent.com/pbkwee/distrorejuve/master/distrorejuve.sh
sudo bash -x distrorejuve.sh --dist-upgrade | tee -a ~/distrorejuve.log | egrep -v '^\+'

This script will add GPG keys where required, update your sources.list with the new repositories.  Add support for old-releases repositories where applicable, report config file conflicts.

Expect the upgrade to take an hour or two.  After the upgrade expect to spend 'a bit of time' fiddling with configs and testing things.

The upgrade process typically requires some downtime, and requires you to perform checks and config tweaks.  So in some cases it may be preferable to install a new server and migrate your apps to that.  Or you could clone the VM (via VM ordering and install process) and run the upgrade on the clone.  After the clone is upgraded and you are happy it is working as you expect, you can either change DNS settings to point to the new IP, or overwrite the original VM with the upgraded VM (to retain the IP address).

If you get stuck, or would prefer RimuHosting support to run the dist-upgrade, just pop in a support ticket.  There would typically be a USD 60 sysadmin fee per server to run the upgrade.

Manually running a dist-upgrade

If you are upgrading a VPS, it is highly recommended to take a backup snapshot before proceeding, just in case rolling back is required.

Follow the "Network Upgrade" steps on the Ubuntu Upgrade page.

However the following steps are usually sufficient to upgrade your VPS software. As always, if you are not sure, feel free to get one of our staff to assist you by popping in a support ticket.

# Install update-manager-core if it is not already installed:

sudo apt-get install update-manager-core

# Launch the upgrade tool:

sudo do-release-upgrade

# Follow the on-screen instructions. 

Bionic Beaver (18.04)

There are no known issues with the upgrade process.

However, upgrades from 16.04 using do-release-upgrade will not be available until August 2018, after 18.04.1 is released (see https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes#Upgrading_from_Ubuntu_16.04_LTS_or_17.10)

Xenial Xaurus (16.04)

There are no known issues with the upgrade process from 14.04 at this time.

Trusty Tahr (14.04)

Make sure to comment out any lines in /etc/fstab for /dev/ and related filesystems like /dev/shm. Those should be automounted by our newer kernels. Then our most recent kernels should work.

Quantal Quetzal (12.10)

Before running do-release-upgrade run chmod 777 /var/run/screen and edit /etc/update-manager/release-upgrades to set "Prompt=normal" (meaning go to the next release, not wait for an LTS release).

During the install you may encounter the following question, select Yes.


[package grub-pc]
Writing GRUB to boot device failed - continue?

When the upgrade finishes, and you are prompted to execute a reboot, select no.

Check that plymouth (the graphical 'splash' screen) has not been re-enabled again:


# cd /etc/init
# for i in plymouth*; do mv $i $i.backup; done 

We have built a new kernel from the 3.6 series which works well for this release. After dist-upgrading just change the kernel via our control panel which will take care of the reboot for you, and you should be all set.

Precise Pangolin (12.04 LTS)

We provided a 3.1.9 kernel which works well for this release so far.

Oneric Ocelot (11.10)

No special notes, upgrades seem to work consistently

Migrating to Natty Narwhal (11.04 - end of lifed)

For those upgrading rather than using our clean install you may find rsyslogd goes to 100% CPU after logrotate runs. This is due to a known bug in the latest version. The fix is to revert to an older version of the rsyslog package. ref https://launchpad.net/ubuntu/natty/+package/rsyslog for more info on available versions and files

Pin to the older versions so it wont break again when we update


echo 'Package: rsyslog
Pin: version 4.2.0*
Pin-Priority: 1002
'>> /etc/apt/preferences

Grab the older version of the package, make sure you get the right version for your system.


wget http://launchpadlibrarian.net/39741428/rsyslog_4.2.0-2ubuntu8_i386.deb
  OR
wget http://launchpadlibrarian.net/39741415/rsyslog_4.2.0-2ubuntu8_amd64.deb

And install that...


dpkg -i rsyslog_4.2.0-2ubuntu8_i386.deb 
service rsyslog restart

Additionally we recomend using the 2.6.34 or 2.6.35 kernel available from our kernel chooser for best reliability

Migrating to Lucid Lynx (10.04 LTS)

You will need a 2.6.33.3 or above kernel to run 10.04. This can be set via the control panel: http://rimuhosting.com/cp/vps/kernel.jsp

Then do the upgrade using do-release-upgrade as normal.

Once the upgrade is completed, add the following to /etc/fstab (before rebooting):

dev  /dev  devtmpfs  rw  0  0

Sometimes you have to replace devtmpfs with just tmpfs in the line above.

There may be plymouth warnings on the console at the next reboot. Disable those by running:

cd /etc/init
for i in plymouth*; do mv $i $i.disabled; done

Example udev errors:

udevd[989]: failed to create queue file: No such file or directory

udevd[989]: error creating queue file

init: udev main process (989) terminated with status 1
init: udev main process ended, respawning
init: udevmonitor main process (991) terminated with status 2
udevadm[1711]: error sending message: Connection refused

Example plymouth errors:

init: plymouth main process (920) killed by SEGV signal
init: plymouth-splash main process (3672) terminated with status 2
init: plymouth-log main process (3685) terminated with status 2

Additional notes regarding Lucid

If you are considering upgrading a dedicated server and that is one of our dedicated servers, please contact support@rimuhosting.com or pop in a support ticket to verify the module for the network port will work after a restart. This specifically affects servers that use the e1000e nic driver, which is not included in the distribution kernels. The resolution is to build an updated module from the latest source for that module.

It uses upstart/service for things like MySQL. So rather than enabling MySQL with:

update-rc.d mysql defaults

You'll need to: mv /etc/init/mysql.conf.disabled /etc/init/mysql.conf.

i.e.:


root@vps:/etc/init# mv mysql.conf.disabled mysql.conf
root@vps:/etc/init# start mysql
mysql start/running, process 4125

(MySQL and Dovecot are the only services that are installed but disabled by default in our images.)

Console devices are set in /etc/init/tty1.conf.

We're now using the dovecot-postfix package: http://packages.ubuntu.com/lucid/dovecot-postfix

This means that Maildirs are enabled by default, Dovecot is used for final delivery to Maildirs, and Dovecot must be started for authenticated relaying to work (i.e. Dovecot now provides all authentication for Postfix). saslauthd is gone.

The root account does not receive mail in this setup, you will need to alias root's email to another user you create.

Migrating from Dapper (6.06 LTS) to Hardy (8.04 LTS)

Ubuntu have stated that there *is* an upgrade path available for this process. It is likely that a reinstall may be a faster option, however refer to the links above for more information.

Migrating from Gutsy (7.10) to Hardy (8.04 LTS)

I have used the following process with no apparent issues on a clean install. Please note that this update includes newer versions of important software, such as mysql and the apache web server.

You should only upgrade one increment at a time (eg. not from Edgy to Hardy).


export DEBIAN_PRIORITY=critical
export DEBIAN_FRONTEND=noninteractive
sed --in-place 's/gutsy/hardy/' /etc/apt/sources.list
apt-get update 
apt-get -y dist-upgrade

Hardy 8.04 console issues after dist-upgrade

Ubuntu 8.04 uses /etc/event.d rather than /etc/inittab. If you dist-upgrade, you may not have /etc/event.d/tty1, so no console/login after it boots. It should contain something like:


# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/getty 38400 hvc0

(the hvc0 may need to be tty1 - check 'dmesg | grep con' for the console device)

Run start tty1 to get the console active without rebooting the VPS.

Migrating from Feisty (7.04) to Gutsy (7.10)

The same tried an true method works for this upgrade as well as the one from Edgy to Feisty. Please note you should only upgrade one increment at a time (eg. not from Edgy to Gutsy).


export DEBIAN_PRIORITY=critical
export DEBIAN_FRONTEND=noninteractive
sed --in-place 's/feisty/gutsy/' /etc/apt/sources.list
apt-get update 
apt-get -y dist-upgrade

If you suddenly get a lot of segfaults then you possibly have the wrong libc6 installed. This is easily fixed by the following command.s


apt-get remove libc6-i686
# optionally you can install the following if this gives you errors.
apt-get install libc6-xen

Migrating From Edgy (6.10) To Feisty (7.04)?


export DEBIAN_PRIORITY=critical
export DEBIAN_FRONTEND=noninteractive
sed --in-place 's/edgy/feisty/' /etc/apt/sources.list
apt-get update 
apt-get -y dist-upgrade

Migrating From Breezy Badger to Dapper Drake

Did you get setup with an Ubuntu 5 Breezy Badger distro?  Need the latest Ubuntu 6 Dapper Drake distro?

We have done the dist-upgrade a few times and it runs pretty smoothly.  Just run:


replace breezy dapper -- /etc/apt/sources.list ; apt-get update; apt-get -y dist-upgrade

When asked if you want to keep modified config files, it is best to keep the original ones.  i.e. say N (for no).