Reinstall customized RPMs with repackage and rollback

Posted in Linux

Here’s one very specific way to temporarily remove an RPM package where I think I want it gone, but I want to test to see how the system reacts when the package is completely removed. I dont’ want to just remove it because i’ve made some changes to the config files and perhaps I’ve spliced in a few custom binaries here and there, so it’s really iffy.

I’ll just use preload.x86_64 as an example. Here’s the files installed by the preload package.

# rpm -ql preload

/etc/logrotate.d/preload
/etc/preload.conf
/etc/rc.d/init.d/preload
/etc/sysconfig/preload
/usr/sbin/preload
/usr/share/doc/preload-0.4
/usr/share/doc/preload-0.4/AUTHORS
/usr/share/doc/preload-0.4/COPYING
/usr/share/doc/preload-0.4/ChangeLog
/usr/share/doc/preload-0.4/NEWS
/usr/share/doc/preload-0.4/README
/usr/share/doc/preload-0.4/THANKS
/usr/share/doc/preload-0.4/TODO
/usr/share/man/man8/preload.8.gz
/var/lib/preload
/var/lib/preload/preload.state
/var/log/preload.log

Now i’ll repackage it so my modifications to /etc/preload.conf are saved. This will keep the changes to any files that are listed above in the package. If you’ve added some custom files but they’re not really part of the original list of files in the rpm, this won’t know what to do, but since the conf file is part of the package, it will work just fine.

# rpm -e –repackage preload.x86_64

Now it’s gone, and I can do some testing, install more packages, whatever…

# run stuff here

Ok, time to rollback and put my preload package back on the system. I don’t need the original rpm and I don’t need to worry about any files. Since I removed it with the –repackage option, it will pull it from spool or wherever it’s stored. The key here is that i’m just sitting in some directory, any directory, and I don’t need to supply the packaged file.

# rpm -Uvh –rollback ‘3:00am’

Rollback packages (+1/-0) to Wed Apr  8 06:09:14 2009 (0x47dd277a):
Preparing...                ############################# [100%]
   1:preload                #Cleaning up repackaged packages:########(104%)
        Removing /var/spool/repackage/preload-0.8-7.fc11.x86_64.rpm:

Poof, it’s back. And my /etc/preload.conf has my custom configuration.

# yum list installed | grep preload

preload.x86_64                         0.8-7.fc11               installed
Posted by admica   @   8 April 2009

Related Posts

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« How to remove yum packages without dependencies
Next Post
VNC server on a headless build machine to avoid warnings »
Powered by Wordpress   |   Lunated designed by ZenVerse