Downloading RPMs in Linux

Note

This article is provide as a courtesy. Please contact your OS vendor for assistance with downgrading rpms.

Using RPM to downgrade a Package

Lets start with rpm, because all systems support this otion. To rollback an rpm you need to have the original RPMs, which may be on your system in this directory:

/var/cache/yum/

You’ll have to look thru the subdirectories to see if the original RPMs are still cached by your system. If its not, then you will need to either download an older version of the rpms from our archives, or from your OS vendor depending on what version and build you want to use.

Method 1:

Step 1: Remove thr original RPMs by running the following command for each RPM

rpm -e -nodeps packagename

Step 2: Install the older software by running the following command

rpm -Uvh packagename.oldversion.rpm

Method 2:

Step 1: Use the RPMs oldpackage feature by running the following command

rpm -Uvh --oldpackage packagename.oldversion.rpm

Note

Keep in mind that neither of these methods understands depdency downloading, so you will need to identify all the dependency packages that also need to be removed, and reinstalled.


Using Yum to Downgrade a Package

You can downgrade packages using two methods with yum,both of these are only supported with newer versions of yum. If they do not work on your system, then you will need to use the rpm methods above.

Method 1:

Step 1: Remove the software by running the following command

yum remove packagename

Step 2: Reinstall an older version using the –allow-downgrade option

yum --allow-downgrade install package-1.2.3.4

Step 3: Finally, since you downgraded, yum will need to know not to upgrade this pacakge, so add the package to /etc/yum.conf like the following

vim /etc/yum.conf

#Add the following lines based off of your package name

#exclude packages from updated

exclude=mysql

Method 2:

Step 1: Run the following command

yum downgrade package-1.2.3.4

Note

The step above will nstall version 1.2.3.4 of the pacjage on your system. Keep in mind that in older versions of yum that support “downgrade”, the depsolver doesn’t understand how to do dependency downgrades in yum. If you have one of those versions of yum you will also need to specify anything that is dependent on the package downgrade. If you have a newer version yum, it should work out the dependencies for you.