Tuesday, May 25, 2010

How to remove higher version packages installed from another source in Ubuntu.

Ubuntu 10.04 Lucid Lynx
Linux Mint 9 Isadora

I am currently torn between plain Ubuntu 10.04 Lucid Lynx and Linux Mint 9 Isadora. Previously I have had both Linux Mint 7 Gloria and Linux Mint 8 Helena installed and liked them a lot. The main attraction for me is the MintMenu.

The last one was actually Ubuntu 9.10 with Linux Mint 8 repository set up and the packages from there installed over the Ubuntu packages. The reason for this was technical - I decided to try and set up RAID 0 array with my dual 750GB hard drives and unfortunately only Ubuntu had the so called alternate install available needed to install on RAID while the normal installer in Linux Mint 8 did not recognize this, even if it had been previously created.

Ubuntu 10.04 has made some considerable improvements in many areas over the previous version:
  • My SB Audigy 2 ZS card works fine now even with the 5.1 setup switched on.
  • The 3D desktop with my Radeon HD3870 works also out of the box (though it still recommends the ATI driver, but I have decided not to install it, see the next one for why).
  • The LCD display powerdown works now (saving the backlight) with the automatic Mesa DRI R600 driver.
    Previously the ATI driver broke this LCD powerdown leaving the backlight on and I'm afraid it is still not fixed.
  • The CD/DVD automatic mounting works now with correct volume labels appearing in /media instead of using the cdrom0, cdrom1 and cdrom2 directories previously (yes, I have three drives).
    The volume label automatic creation worked also in prior Ubuntu version but this functionality disappeared mysteriously after I installed Linux Mint packages over Ubuntu ones.
  • The switching between text-mode and graphics is almost instantaneous - I wonder if the kernel graphics mode swithcing is already supported with ATI graphics or is this just very good MESA driver...?
  • The resolution of the text-mode is perfect using the whole 1920x1200 screen with 240x75 characters!
    Previously in Linux Mint 8 or perhaps instead because of the ATI driver, the text-mode was an awful 80x25 and switching back messed up the graphics mode aswell...

After trying out the newly released Linux Mint 9 I felt that it looked and worked very similarly to the previous Linux Mint 8 while the Ubuntu 10.04 was considerable jump forward from 9.10 and therefore I decided to do similar configuration as before (though I'm not using RAID this time) to install Ubuntu 10.04 and then include the MintMenu from the Linux Mint 9 repositories.

What happened, unfortunately, is that I accidentally installed a lot of Linux Mint packages including grub and plymouth related things that affect the booting. I decided to remove these packages but alas, this seemed to be impossible without complete reinstall.
Most of the packages depended on others that depended finally on nearly all of the packages (the list was in hundreds of packages).
While each of these packages had counterpart in Lucid repositories, they all outranked the Lucid ones with higher version numbers.

The apt-get does not provide any way to downgrade nor to use different repository for reinstallation, the dpkg can reinstall any version, including downgrading to an earlier versions, but needs physical .deb files.

The answer was the forgotten aptitude package manager, which has somewhat similar syntax and with simple tasks can be used in place of apt-get, while having considerably more power.

And here is the step-by-step list of how I reverted these packages back to their Lucid Lynx counterpars:
  1. First, in order to know which packages I need to switch back to Ubuntu versions, I listed those packages with dpkg:

    sudo dpkg --list | grep mint

  2. Second, I downloaded the physical .deb files from lucid repository:

    aptitude -t lucid download libplymouth2 plymouth plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text plymouth-x11 python-software-properties software-properties-gtk

  3. Third, I installed these versions with dpkg:

    sudo dpkg --install *.deb

That's it.