Installing rpm's rpm without... rpm!
A friend of mine recently uninstalled the rpm package on his system and panicked. Now thats sure a tough situation. rpm is the lifeline of red hat based distros. Here's what to do in case it happens to you
Download the rpm-4.x.x.i386.rpm package (the version depends upon the version of your distro )
Download this script and make it executable (chmod 775 rpm2cpio.sh)
http://www.rpm.org/tools/scripts/rpm2cpio.sh
Copy the script and the rpm-4.x.x.i386.rpm package in the / directory.
From the / directory, run the following command as root:
./rpm2cpio.sh rpm-4.x.x.i386.rpm | cpio -ivd
This will extract the files from the rpm-4.x.x.i386.rpm package and place them in the right directories, as if you installed it with the rpm command, but without updating the rpm database nor executing any postinstall script.
The pre- and post-install script are described in the attached file, that can be extracted from the rpm-4.x.x.i386.rpm package. You have to run them manually in a console window.
At the end, as extra security option, you could run
rpm -ivh --force rpm-x.x.i386.rpm
This should install rpm over itself, updating the rpm database and executing the pre- and post-install scripts as usual.
1 comment:
Thanks for this post, I just uninstalled rpm when uninstalling subversion and I couldn't find anything on how to reinstall it.
Post a Comment