27 June 2013

In Place Upgrade of Linux Mint

Topics: Linux, Debian and Ubuntu
Tags: linux-mint, ubuntu

My workstation at work was still on Maya and I wanted to update it to Olivia. Mint recommends backing up your data and doing a fresh install, which is how I upgraded my home computers. Even though the install itself is much faster with a fresh install, the total time and work is more than an upgrade.

On Ubuntu there is a do-release-upgrade command which isn’t available on Mint, however, it will let you go forward only one release at a time or from one LTS to the next one. Using this technique should be equally valid for jumping further forward on Ubuntu as it is on Mint.

If you are a beginner at this and don’t know how to fix problems follow their advice. You can use dpkg -l to create a list of your installed packages and you probably want to back that up along with a tarball of your etc directory, and of course your home and any data directories elsewhere on your system. Then do a clean install, reformatting the drive, restore your data and use the backup of dpkg -l and etc to install applications and restore any configuration you had done.

If you can troubleshoot problems on your system, I can both report success and that it was faster than the two other upgrades I’ve done following the reinstall method.

For most of the following you will either need to be root or use sudo.

1. Update your sources.

sed -i ‘s/precise/raring/g’ /etc/apt/sources.list

sed -i ‘s/maya/olivia/g’ /etc/apt/sources.list

Then run apt-get update.

2. The upgrade

apt-get dist-upgrade

3. You will not have a working system

The dist upgrade will fail to update many of your packages due to dependencies processed out of order.

run apt-get -f upgrade to attempt to force packages to upgrade. Then go back to dist-upgrade. You may need to repeat this until there are no or very few un-upgraded packages.

4. Remove leftover packages that didn’t upgrade. Then reinstall them if you need/want them.

5. Reboot the system. As you troubleshoot, reboot as appropriate. This is not Windows, you don’t need to reboot every time you do something, but remember that the boot process sets up things that may not get set/unset the same way when you add/remove something.

6. Deal with the unexpected.

There were X startup errors relating to VirtualBox, since I don’t use VirtualBox, I identified the installed related packages with dpkg -l, and then used apt-get purge to completely remove them and any configurations.

My workstation did not participate in NIS, but the installer had found NIS Servers and defaulted to NIS for authentication. Purging NIS set me back to my local accounts.

I had a problem with MDM (Mint Display Manager), to fix it I removed it and then reinstalled it and some related packages:

apt-get install mdm

apt-get install –reinstall mint-meta-core mintinstall mint-mdm-themes mint-info-cinnamon

7. That was it, cycling through the upgrade/dist-upgrade process a few times, and resolving three  glitches, took about 2 hours, and I had exactly the same system (only better) as a started with, where I would have spent most of the day following the recommended procedure.