[Yum] synthesizing yum transactions?

James Antill james-yum at and.org
Tue Nov 10 20:10:40 UTC 2015


Brian Reichert <reichert at numachi.com> writes:

> I have a topic I brought up in a different forum:
>
>   http://www.spinics.net/lists/centos/msg156915.html
>
> The core question I was trying to ask there is:
>
> Given:
>
> - A server initially provisioned with yum (via Anaconda)
>
> - Subsequently had RPMs added/updated using the rpm utility directly
>
> is there a way to synthesize another yum transaction, describing
> the new RPMs, such that a 'yum rollback history 1' will actually
> do what one would expect?

 With the API anything is possible, assuming transaction 1 is the
install then it shouldn't even be _that_ hard. The history merging
code behind "yum history info 1..last" will give you all the packages
currently installed via. yum. After that you "just" have to create a
fake yum transaction (and yumdb entries, or see the distro-sync below)
with upgrade/delete/install based on the difference between that data
and the rpmdb.

 The way you are trying to do it is not going to end well (the history
transaction created won't be installs but reinstalls, which is why yum
rollback complains).
 You _might_ be able to do it by taking the data from yum history,
doing an install into an installroot and then finding the difference
between that and current (new_rpms?) and doing a real install within
the install root and then copying the data back out. This is basically
the scripting version of the first paragraph.

 If you just want to fix the biggest problems, you can run
"yum distro-sync full". But that'll mostly be a simple way to do the
reinstall you've already tried.

-- 
James Antill -- james at and.org
http://www.and.org/and-httpd/ -- $2,000 security guarantee
http://www.and.org/ustr/
http://www.and.org/vstr/


More information about the Yum mailing list