Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I accidentally deleted all my RPM data (I removed /var/lib/rpm/* instead of /var/lib/rpm/__*), and then ran rpm --rebuilddb. Now when I try to run yum update I get:

Could not parse metalink https://mirrors.fedoraproject.org
/metalink?repo=fedora-$releasever&arch=i386 error was
No repomd file
Error: File /var/cache/yum/i386/$releasever/fedora/metalink.xml does 
not exist

I found that I don't even have the /var/cache/yum/i386 folder anymore after the previous operation. I downloaded the fedora-release RPM of Fedora 18 and locally installed and rebuilt my yum cache (is that what i did?):

rpm -Uvh --replacefiles --replacepkgs /$MYPATH_TO_Fedorareles/fedorarelease-18-0.8.noarch.rpm

This made a new rpmdb where only one package is installed: fedora-release. Since yum thinks that's the only package installed, if I try to install anything it resolves the dependencies and queues lots of packages for install that I actually already have installed.

How do I make yum aware of all the packages that are already installed? I don't want to reinstall anything, and I don't want to download 500MB of RPMs.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Unfortunately you are going to have to repopulate the rpmdb, and you can only do that if you have the RPMs itself. You can pass --justdb to rpm when performing a package install/update/erase, but you will need the actual package available.

share|improve this answer
1  
Just make absolutely sure that the packages really are there. –  vonbrand Jan 25 '13 at 0:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.