Downgrading packages using yum

by levien on do 27 maart 2008 // Posted in misc // under

In Linux-land there are two major package management systems, APT/dpkg and YUM/RPM. My favourite of the two is definitely APT, which is mostly used by Debian and derivatives such as Ubuntu. Yum is used by Red Hat and derivatives such as CentOS, Fedora and SME, and works just fine for installing packages.

When it comes to more complicated package maintenance tasks however, yum tends to be very frustrating. APT's apt-get command has a huge range of switches, which let you do all kind of black magic like ignore dependencies and downgrade packages to an earlier version. Yum just has the --exclude switch, and even that often fails due to unmet dependencies.

A few days ago our SME server got its server-manager clobbered by an accidental perl update (serves me right for trying to install MySQL 5 ;-). Now SME is a great system, but unfortunately it uses yum for package-management. So I had to spend an hour or so figuring out how to downgrade perl back to the original version.

Apparently downgrading can only be done by manually downloading older versions of the RPM files and installing them using rpm -U --oldpackage. Ugh.

Luckily, it turned out that the authors of yum have created a collection of tools, the Yum Utils. While these still don't allow you to downgrade packages, you can at least use yumdownloader to easily fetch the correct RPM files.

You can download Yum Utils at http://linux.duke.edu/projects/yum/download/yum-utils/

On many systems you might be able to do a yum install yum-utils, but for SME you'll have to download an RPM file and install it using yum localinstall.