Upgrading Ubuntu 10.04 to Ubuntu 14.04 with Mate desktop

We shall upgrade Ubuntu 10.04 with Gnome 2 desktop to 14.04 (also an LTS or Long Term Support release), but the 14.04 will use the Mate desktop, which looks like the traditional Gnome 2 (since Mate is a fork of Gnome 2) instead of the Unity desktop.

The command "do-release-upgrade" will be the method, with some PPAs (Personal Package Archives) added at the end to bring in the Mate desktop on to the system.

A slight complication is that there are limitations on the free space on the root partition.

Further more, the host is about 5,000 km away and owned by someone without technical experience or much sysadmin ability to fix anything that goes wrong.

All access is via ssh through a VPN which auto-connects back to this host.

We will test this in a VM under KVM.

Read Part 1 to get started.

Upgrading Ubuntu Step 1: 10.04 to Ubuntu 12.04

For this project, the goal is to update a remote Ubuntu 10.04 system running good ol' Gnome 2.x (of course) to Ubuntu 14.04 with Mate desktop (a fork of Gnome 2.x) instead of Unity.

The command "do-release-upgrade" will be the method, with some PPAs added at the end to bring in the Mate desktop on to the system.

A slight complication is that there are limitations on the free space on the root partition.

Further more, the host is about 5,000 km away and owned by someone without technical experience or much sysadmin ability to fix anything that goes wrong.

All access on the eventual target will be via ssh through a VPN which auto-connects back to this host, so we'll do this work via ssh to the VM.

We will test this in a VM under KVM.

Our kernel to start with is:

Linux mom-desktop 2.6.32-73-generic #141-Ubuntu SMP Tue Mar 10 17:15:40 UTC 2015 i686 GNU/Linux

And our free space situation on relevant drives is thus:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 13G 7.8G 4.5G 64% /
/home/mom/.Private 7.7G 4.6G 2.7G 63% /home/mom

So, let us first create a VM with a fresh Ubuntu 10.04, 32-bit version:

# virt-install --name="UbuntuMate" --description="do-release-upgrade'ing 10.04 to 14.04 with Mate" --cdrom=/mnt/data/comm/download/Linux/Ubuntu/ubuntu-10.04.3-desktop-i386.iso --disk="/mnt/data/temp/kvm-pools/ubuntu-mate.qcow2",format=qcow2,size=20,sparse=true --hvm --graphics=vnc --ram=4096 --vcpus=2,maxvcpus=4

 

Starting install...
Allocating 'ubuntu-mate.qcow2' | 20 GB 00:00
Creating domain... | 0 B 00:01
No protocol specified

** (virt-viewer:1052): WARNING **: Could not open X display
No protocol specified
Unable to init server: Could not connect: Connection refused
Cannot open display:
Run 'virt-viewer --help' to see a full list of available command line options
Domain installation still in progress. You can reconnect to the console to complete the installation process.

Oh dear, no graphical interface opened. Because running as root? Not seen this before.

However, our new Ubuntu VM is running:

# virsh list --all
Id Name State
----------------------------------------------------
2 UbuntuMate running

And using virt-manager, we see our Ubuntu VM has booted and is ready to begin installing:

Ubuntu-10.04-installing.png

The installation process completed; strictly a default setup with separate / and /home partitions and openssh-server for remote access from the host machine.

We're ready to begin the testing.

First thing, one will notice under the "Avail" column that the VM has more free disk space on / than the real target computer:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 2.3G 11G 18% /

... by quite a bit. So, I will consume some of it with a Very Large File:

# dd if=/dev/zero of=/delete.me bs=1M count=6500
6500+0 records in
6500+0 records out
6815744000 bytes (6.8 GB) copied, 242.576 s, 28.1 MB/s

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 8.7G 4.5G 67% /

That should work for our purposes -- testing complexity of process and if target computer has sufficient space.

In a terminal window connected via ssh (for easier copying & pasting, plus the terminal has 4 tabs already being used, so less window switching):

# do-release-upgrade
Reading cache
Checking package manager
Continue running under SSH?

This session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in case of failure it is harder to recover.

If you continue, an additional ssh daemon will be started at port '1022'.
Do you want to continue?

Continue [yN] y

Starting additional sshd

To make recovery in case of failure easier, an additional sshd will be started on port '1022'. If anything goes wrong with the running ssh, you can still connect to the additional one.

To continue please press [ENTER]

And... meet you back here in an hour or so - it's a slow process.

While you were gone, this informational prompt came up, I'll show you what it said so there will be no surprises (and to show off to Windows users the type of help one can expect from the system as opposed to "Error 43927489XKQ8B: Things is b0rked, good luck" that they're sadly used to):

Fetched 20.4 MB in 6s (576 kB/s)

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done

Calculating the changes
Calculating the changes

Do you want to start the upgrade?

32 installed packages are no longer supported by Canonical. You can still get support from the community.

44 packages are going to be removed. 679 new packages are going to be installed. 1123 packages are going to be upgraded.

You have to download a total of 896 M. This download will take about 24 minutes with your connection.

Installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.

Continue [yN] Details [d]y

 

Well, it's "tomorrow" now. I've been waiting for the computer, it's been waiting for me. I got to sleep, it's kept busy 24/7.

But we're getting close. I've taken a couple screen captures of libc6 and grub config screens and now it's asking this:

update-initramfs: Generating /boot/initrd.img-3.2.0-80-generic-pae

Searching for obsolete software
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done
Building data structures... Done

Remove obsolete packages?

120 packages are going to be removed.

Removing the packages can take several hours.

Continue [yN] Details [d] y

The process continues...

The process finishes:

System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] y
Broadcast message from root@mom-desktop
(/dev/pts/2) at 16:03 ...

The system is going down for reboot NOW!
=== Command detached from window (Wed Apr 29 16:03:04 2015) ===
=== Command terminated normally (Wed Apr 29 16:03:04 2015) ===Connection to 192.168.122.117 closed by remote host.
Connection to 192.168.122.117 closed.

 

Done:

$ uname -a
Linux mom-desktop 3.2.0-80-generic-pae #116-Ubuntu SMP Mon Mar 23 17:29:27 UTC 2015 i686 athlon i386 GNU/Linux
mom@mom-desktop:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"


Oddly, in the desktop screenshot below, it appears at first glance that the system is running 14.04 already. This is not correct however - it's prompting us to upgrade to 14.04 Trusty Tahr.

Ubuntu-10.04-to-12.04-done.png

Finally, here's the free space post do-release-upgrade from 10.04 to 12.04 - it appears unchanged!

root@betty-desktop:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 8.7G 4.5G 67% /


This article has gotten longer than I anticipated, so the next do-release-upgrade will be a separate page.

Upgrading Ubuntu 12.04 to Ubuntu 14.04 with Mate desktop: Step 2

In the first part of this guide, we upgraded from Ubuntu 10.04 to Ubuntu 12.04 in a KVM virtual machine (VM).

There were 4.6 GB free space on / (root) partition when we started, and after do-release-upgrade had finished, we had:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 11G 2.9G 79% /

So, 2.9 GB free. Since running out of space would be less than desirable, we'll free some from apt's cache:

# apt-get clean
# df -h
Filesystem Size Used Avail Use% Mounted on
dev/vda1 14G 9.7G 3.4G 75% /

Now we have 3.4 GB free space - that should be acceptable. LibreOffice could be uninstalled prior to running another do-release-upgrade if there's a concern about requiring more space still, but I don't think it's necessary - so let's risk proceding as is.

# do-release-upgrade
Reading cache
Checking package manager

Continue running under SSH?

This session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in case of failure it is harder to recover.

If you continue, an additional ssh daemon will be started at port '1022'.
Do you want to continue?
Continue [yN] y
Starting additional sshd

To make recovery in case of failure easier, an additional sshd will be started on port '1022'. If anything goes wrong with the running ssh, you can still connect to the additional one.
If you run a firewall, you may need to temporarily open this port. As this is potentially dangerous it's not done automatically. You can open the port with e.g.:
'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'

To continue please press [ENTER]

Once again, we're doing this through SSH because the eventual "production" target is best accessed that way, because it's more convenient, because that's how remote machines are administered.

If you're doing this at home, you won't need SSH.

Regardless, the process asks another question:

Calculating the changes

Do you want to start the upgrade?

58 packages are going to be removed. 699 new packages are going to be installed. 1567 packages are going to be upgraded.

You have to download a total of 940 M. This download will take about 24 minutes with your connection.

Installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.

Continue [yN] Details [d]y

Supper and beverage time while things proceed...

Approximately 3 hours later we're prompted with this:

Searching for obsolete software
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done
Building data structures... Done

Remove obsolete packages?
191 packages are going to be removed.
Removing the packages can take several hours.

Continue [yN] Details [d]y

And... a few minutes later, it seems we're up to Ubuntu 14.04:

System upgrade is complete.
Restart required
To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] y
Broadcast message from root@mom-desktop
(/dev/pts/1) at 2:16 ...

The system is going down for reboot NOW!
=== Command detached from window (Tue May 5 02:16:45 2015) ===
=== Command terminated normally (Tue May 5 02:16:45 2015) ===
Connection to 192.168.122.117 closed by remote host.
Connection to 192.168.122.117 closed.

After the system reboots:

$ ssh me@192.168.122.117
me@192.168.122.117's password:
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-51-generic i686)

* Documentation: https://help.ubuntu.com/

Yay, the upgrade was successful. Except now we have Unity as a desktop. And our free disk space is not good, with 1.3 GB free:

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 12G 1.3G 91% /
# apt-get clean
# apt-get autoclean
# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
compiz-plugins-main gnome-dictionary gnome-search-tool hyphen-en-us libquvi-scripts libquvi7 libreoffice-emailmerge libreoffice-help-en-gb libreoffice-l10n-en-gb libreoffice-l10n-en-za mythes-en-us printer-driver-hpijs
0 upgraded, 0 newly installed, 12 to remove and 0 not upgraded.
After this operation, 60.4 MB disk space will be freed.
Do you want to continue? [Y/n] y

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 11G 2.2G 84% /

Better: 2.2 GB free space is acceptable considering we started with 4.5 GB and haven't cleaned out anything unneeded.

In the next step, we'll finally install Mate desktop.

Upgrading Ubuntu 10.04, Step 3: 14.04 to Mate desktop

Our upgrade process is almost complete - the time-consuming steps of running do-release-upgrade twice was performed in previous steps (Step 1 and Step 2.

For this final step, we install the Mate desktop to replace Unity.

First things first: this test is running in a virtual machine (VM) instead of on real hardware. And advantage is that we can take a snapshot of the state of the VM so that if things go wrong, we can revert.

# virsh snapshot-create-as UbuntuMate UbuntuMate14.04 "Ubuntu 14.04 prior to installing Mate repos"
Domain snapshot UbuntuMate14.04 created
# virsh list --all --with-snapshot
Id Name State
----------------------------------------------------
- UbuntuMate shut off
# virsh snapshot-list UbuntuMate
Name Creation Time State
------------------------------------------------------------
UbuntuMate14.04 2015-05-05 15:18:09 -0700 shutoff

Okay, snapshot / backup made, here's what we're starting with:

Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-51-generic i686)

* Documentation: https://help.ubuntu.com/
$ uname -a
Linux mom-desktop 3.13.0-51-generic #84-Ubuntu SMP Wed Apr 15 12:11:46 UTC 2015 i686 athlon i686 GNU/Linux

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 11G 2.2G 84% /



Ready to start. The Mate Desktop Wiki is our guide - they probably explain things better than I do. And a giant thank-you to Martin Wimpress for his development work and his guest spots on the following podcasts: Linux Luddites, MintCast, LAS Unplugged.

Let's add the repositories (repos) with the following two commands:

sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
Package repository for Ubuntu MATE.

Packages living here are either required to build the Ubuntu MATE .iso mages or provide the meta packages.
More info: https://launchpad.net/~ubuntu-mate-dev/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpqt8oerjp/secring.gpg' created
gpg: keyring `/tmp/tmpqt8oerjp/pubring.gpg' created
gpg: requesting key 162506E7 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpqt8oerjp/trustdb.gpg: trustdb created
gpg: key 162506E7: public key "Launchpad PPA for Ubuntu MATE Remix Developers" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK

One done, one to go:

sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
These MATE 1.8.1 packages for *only* Ubuntu Trusty, they have been side ported from Debian.

In order to correctly install and configure MATE 1.8.1 on Ubuntu Trusty you will also need to add the following PPA:
  * ppa:ubuntu-mate-dev/ppa

We've already done that command recommended in the last line above!

Open a terminal complete the following steps to enable the appropriate PPAs and install MATE 1.8.1 on Ubuntu Trusty.
    sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
    sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate

Again, we've already run the first command, and we're running that second command right now. (Odd that the output of a command is to... run that command. Huh.)

To continue with the output of the last command:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install --no-install-recommends ubuntu-mate-core ubuntu-mate-desktop
More info: https://launchpad.net/~ubuntu-mate-dev/+archive/ubuntu/trusty-mate
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpdh4otxcu/secring.gpg' created
gpg: keyring `/tmp/tmpdh4otxcu/pubring.gpg' created
gpg: requesting key 162506E7 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpdh4otxcu/trustdb.gpg: trustdb created
gpg: key 162506E7: public key "Launchpad PPA for Ubuntu MATE Remix Developers" imported

gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK


As per the advice above, an update of the repo cache and an upgrade of the software is recommended next; we'll do that momentarily with sudo apt-get update ; sudo apt-get upgrade.

Finally, do we want a vanilla Mate desktop, or an Ubuntu-branded one?

From the Mate Wiki again:

Ubuntu MATE is a more comprehensive option that offers a slightly tweaked layout, configuration, and themes to integrate into Ubuntu in a more seamless fashion. This will install the complete MATE Desktop Environment as well as LightDM and numerous other applications to provide a full and well rounded desktop.

The output from the last command above gives instruction to install the Ubuntu version via sudo apt-get install --no-install-recommends ubuntu-mate-core ubuntu-mate-desktop.

I think it best to choose the Ubuntu Mate version as recommended.

Once it's been screen-shot-captured, perhaps I'll roll-back the VM snapshot and install the Vanilla Version to screen shot it too, for comparison.

So, per last output pasted above, as always, running as root (saves us tying "sudo" a bunch of times, and providing passwords frequently) :

# apt-get update
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
deja-dup linux-generic linux-generic-pae linux-headers-generic
linux-headers-generic-pae linux-image-generic linux-image-generic-pae
The following packages will be upgraded:
compiz compiz-core compiz-gnome compiz-plugins compiz-plugins-default
compizconfig-backend-gconf deja-dup-backend-gvfs gtk2-engines-pixbuf
libcompizconfig0 libdecoration0 libgail-common libgail18 libgtk2.0-0
libgtk2.0-bin libgtk2.0-common libvte-common libvte9 linux-libc-dev ppp
python-vte
20 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Need to get 14.5 MB of archives.
After this operation, 24.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

(gconftool-2:4963): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Uh-oh, looks like running via SSH caused a minor problem, but I doubt it's a game-stopper.

# apt-get install --no-install-recommends ubuntu-mate-core ubuntu-mate-desktop
Need to get 114 MB of archives.
After this operation, 401 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

That took a rather long time, but at the end:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 12G 1.6G 88% /

We can clean some stuff up:

# apt-get clean
root@mom-desktop:~# apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
root@mom-desktop:~# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
root@mom-desktop:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 12G 1.8G 87% /

Really, we want to clean out Unity to save a bunch of space.

$ sudo apt-get remove unity
[sudo] password for mom:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gstreamer1.0-plugins-base-apps liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 libqt5webkit5-qmlwebkitplugin libreoffice-presentation-minimizer libufe-xidgetter0 libunity-webapps0 oxideqt-codecs qtdeclarative5-accounts-plugin qtdeclarative5-dialogs-plugin qtdeclarative5-privatewidgets-plugin qtdeclarative5-ubuntu-ui-extras-browser-plugin qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets ubuntu-settings unity-webapps-common unity-webapps-qml unity-webapps-service webaccounts-extension-common webapp-container webbrowser-app xul-ext-unity xul-ext-webaccounts xul-ext-websites-integration
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
ubuntu-desktop unity unity-2d
0 upgraded, 0 newly installed, 3 to remove and 7 not upgraded.
After this operation, 6,667 kB disk space will be freed.
Do you want to continue? [Y/n]

After a restart:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 14G 12G 1.8G 87% /

But there's more Unity cruft sitting around, so try to get rid of all of it:

# apt-get remove unity-*
0 upgraded, 0 newly installed, 96 to remove and 6 not upgraded.
After this operation, 50.6 MB disk space will be freed.
Do you want to continue? [Y/n]

I cut the packaage list out from above (all 96 of them).

Rebooting brought up a warning about corrupted graphics:
Ubuntu-10.04-to-12.05-removed-Unity-twice-borked-graphics.png

I chose to run in reduced graphics mode and got the nice Mate login screen:
Ubuntu-10.04-to-12.05-Mate-fixed-login-screen.png

Below is our new, lovely Mate desktop on Ubuntu 14.04
Ubuntu-10.04-to-12.05-Mate-at-last.png