Re: "rollback" yum update

Amos Shapira <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
2009/1/24 James Williams <[email protected]>
>
>
> Hi,
>
>   How do you "rollback" a yum update?  If for some reason yum update packagename causes a problem
> is there a yum way to resotre back to the previous version?
>
>   Or is the only way to remove the package and then download the original rpm and install it.
>
>   Is there a better way?

I'm no expert and would love to hear a better way but the way I plan
to do this if/when I need to is to keep a nightly list of versions of
packages then restore to them if something gets screwed up.

This is where I miss having "package x replaced <old ver> by <new
ver>" in the log, as dpkg/apt/aptitude does on debian.

A similar situation is copying of entire list of versioned packages
from one host to another, for which I accumulated the following
instructions:
--------------------
To generate list of current packages including version and release:

rpm -qa --queryformat="%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" | sort > file

This produces the list in format suitable for yum:

yum install $(< file)

To list packages which appear only in dest-host, run the above "rpm
-qa" and then compare using "comm":

comm -23 source-host dest-host

Delete them with 'yum erase' (e.g. "comm -23 source-host dest-host |
xargs yum erase")
--------------

If you replace "source host" by "host before yum update" and "dest
host" by "host after yum update" then you should be able to roll back
to previous set of package versions.

Cheers,

--Amos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.