This is my experience several months ago, I rewrite the details for the sake of my reference. The operating system is Fedora Core 4 but I believe this tutorial is applicable for any RPM-based Linux distro.
Symptom
User complaint there was a problem to install a RPM file,
[root@www ~]# rpm -iv /tmp/packet.core error: Unable to open /usr/lib/rpm/rpmrc for reading: No such file or directory. [root@www ~]# cd /usr/lib/rpm -bash: cd: /usr/lib/rpm: No such file or directory
Looks like /usr/lib/rpm was missing/deleted. Damn! I wish I know who is the culprit.
Steps Taken To Repair
- Download RPM package for Fedora Core 4 from http://mirrors.kernel.org/fedora/core/4/i386/os/Fedora/RPMS/rpm-4.4.1-21.i386.rpm
- Extract the RPM file (in MS-WIndows, use 7-Zip)
- Copy the whole /usr/lib/rpm from above step to the server
- Re-install RPM again,
[root@www ~]# rpm -ivh --force /tmp/rpm-4.4.1-21.i386.rpm warning: /tmp/rpm-4.4.1-21.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2 Preparing... ########################################### [100%] 1:rpm ########################################### [100%]
- Verify the installation is successful and the RPM DB is not corrupted,
[root@www ~]# rpm -q rpm rpm-4.4.1-21
- The package should be able to be installed now,
[root@www ~]# rpm -ivh --test /tmppacket.core Preparing... ########################################### [100%] package OB2-CORE-A.06.00-1 is already installed
Everything is working back, yay!
{ 1 } Comments
what a leetness talk!
UsingPost a Comment