December 12, 2013

Updating Linux mint ... Ubuntu style!

Every mint distribution, and Ubuntu distribution for that matter, has a distribution name attached. Linux mint12 is called Lisa, mint13 is called Maya etc. All names for Linux mint versions can be found at: old releases and for Ubuntu at: releases
The dist-upgrade trick is to find your current Linux mint release, if you don’t know the name already, it can be found by issuing:
grep mint /etc/apt/sources.list
deb http://packages.linuxmint.com/ lisa main upstream import
The distribution name is preset at the first space after the URL. To get the Ubuntu name replace mint in the grep expression, the list is a bit longer, but the name is still present in the same place. The Ubuntu version is oneiric

You can follow this approach when upgrading all your mint installations, but you should only go one increment at a time.
The best approach for updating is to install the system you’d like to update in a virtual machine, and then apply the update to that system to see what actually happens. Using this approach may seem somewhat overkill, but it is likely to save you a lot of work when trying to fix your broken installation later.

Before you begin you should know that the mint-search-addon package cannot be resolved.
sudo aptitude remove --purge mint-search-addon
If you do not have a log in manager, i.e. mdm you should install this and log out and back in to check that the new manager works flawlessly.
sudo aptitude install mdm
Installing and configuring mdm should ensure that you’re not logging into X using the start X script, as this will most likely break your x log in after the dist upgrade. The Ubuntu x script will be replacing the mint x script, leaving you at an old school log in shell.
sudo aptitude upgrade && sudo aptitude clean
Once the updates has run reboot to ensure that any unknown dependencies are set straight prior to the actual dist upgrade.
sudo reboot
When the system is back in business it’s time to start the actual dist upgrade. We’ll be doing the upgrade Ubuntu style. Issue (Yes I know it a long command):
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup && sudo perl -p -i -e "s/lisa/maya/g" /etc/apt/sources.list && sudo perl -p -i -e "s/oneiric/precise/g" /etc/apt/sources.list && sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean
Notice that the dist upgrade is done using apt-get and not aptitude, this is recommended by Ubuntu, so I’ll use it here but that is the only place.
You should follow the dist upgrade closely, as there will be issues you’ll need to resolve during the dist upgrade. Issues with respect to your current machine’s configuration.
BEWARE: You should not blindly accept changes to your existing /etc/sudoers file! That is the rationale why -y has not been added to the dist-upgrade command. If you are in doubt select the package maintainers version, I usually do this on any update, your old version will be placed by the dpkg program so you’ll always be able to find your old configuration.
With the new packages installed, cross your fingers, hope for the best, and reboot.
sudo reboot
If you get a black screen when you reboot your (virtual) machine, it is most likely due to the graphical support has failed. Try hitting ctrl+f1 to get a old school log in prompt. Log in, then do the upgrade in the terminal until there’s nothing left.
sudo aptitude upgrade
My upgrade stopped at the mint-search-addon package for Firefox, but you have removed this package so it should not cause any problems. If it does anyway run the remove command from above again. 

Once all the upgrades have run you’re ready for starting X to get a feel of what the problems with going graphical may be.  In my case it was a missing setting for the window manager, I had only lightmd installed which attempted to start an Ubuntu session :(
Use the mdm window manager to get things up an running, if you get the missing file /usr/share/mdm/themes/linuxmint/linuxmint.xml dialog it means you’re missing the mint-mdm-themes package so issuing:
sudo aptitude install mdm mint-mdm-themes mint-backgrounds-maya mint-backgrounds-maya-extra
sudo service mdm start
Should bring you to a graphical log in prompt. All you have to do now is resolve the over dependencies that you may have.
My new kernel should not be reconfigured because a link was missing in grub. /usr/share/grub/grub-mkconfig_lib be either a symbolic link or a copy. Setting the symbolic link to /usr/lib/grub/grub-mkconfig_lib can be fixed by:
cd /usr/share/grub/
ln -s grub-mkconfig_lib /usr/lib/grub/grub-mkconfig_lib
then
dpkg --configure -a
Fixed the missing configurable parts for the new kernel dependencies. Now, the kernel image from the old Linux mint12 system must be removed, because it interrupts aptitude and dpkg. The old kernel is removed by:
sudo aptitude remove linux-image-3.0.0-32-generic
Finally, reboot. Wait. Then, once the system is up again, you should be, you’ll need to activate the new repository sources, since dist-upgrade only sets packages to the distribution packages. It does not automatically choose the latest versions of those packages, issue:
sudo aptitude update
sudo aptitude upgrade
Voila, you should be good to go. Some indies may not be hit, some packages may not be installed check the update status from aptitude update there’s a [-xx] counter in the bottom of the terminal, where - means there’s still stuff you could upgrade. Now, if you're up for it, you should try to update to Linux mint 14 (nadia) from this platform ;)


No comments: