PDA

View Full Version : A strange error with yum



fedvasu
8th October 2012, 08:10 PM
I wanted to clear the cache of yum so id rm -rf /var/lib/rpm/* and rebuild the rpm
(just wanted to free up space)
but somehow i got this error


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

and i solved by rebuilding my rpm package metadata using fedora18-release.rpm (this solution was provided in one of the threads here)

so here is what i basically did



rpm -Uvh --replacefiles --replacepkgs /$MYPATH_TO_Fedorarelese/fedora-release-18-0.8.noarch.rpm


so now yum works but to yum only one rpm is installed on the system i.e fedora-release

so whenever i say yum install gcc int resolves deps and prompts me to install eventhough , i have already installed gcc and works fine , instead of saying gcc package is already installed

if i want to install ghc it starts by downloading gcc and other stuff which is already installed , is ther any way around it?

funny i tried to solve one problem , which lead to series of fixing and new problems. :(

DBelton
8th October 2012, 08:18 PM
well, one thing..

You didn't say if you rebuilt the rpm databases after you deleted things. (You really deleted more than you should have as well)


I usually only delete the __db* files when I delete them manually like you did.

Then

rpmdb --rebuilddb

fedvasu
8th October 2012, 08:29 PM
well, one thing..

You didn't say if you rebuilt the rpm databases after you deleted things. (You really deleted more than you should have as well)


I usually only delete the __db* files when I delete them manually like you did.

Then

rpmdb --rebuilddb

of course i did rpm --rebuilddb .

but i agree that i deleted more than required , is ther a way to make yum aware of all the installed packages now that i shot myself in the foot.

any yum/rpm/packaging nerds to the rescue?

PabloTwo
8th October 2012, 09:28 PM
Try,

# rpmdb --initdb --rebuilddb
And from now on, when you want to clear any of yums cache, use the "yum clean <arg>" command. yum doesn't put anything in /var/lib/rpm/, rpm does. You totally blew away your rpm database, which yum depends on.

marko
8th October 2012, 11:55 PM
Recently I found it's also handy to do:


yum clean all --enablerepo=*

this way ALL the repository info is cleaned and not just the ones you have enabled, I would prefer that "yum clean all" default to cleaning even the disabled repos caches but it doesn't

DBelton
9th October 2012, 12:01 AM
I do that about once a month here, marko :) Make sure everything is cleared out in case I have temporarily enabled a repo someplace.

But as for the original problem, I don't really know of much way to get back the installed packages database if rebuilding the databases didn't work. I am sure the information is stored some place, like in logs,, etc... but I don't have a good way for rpm (or yum) to pull it in and rebuild the database.

Surely there has to be some tool that will scan a system and build the rpm database from packages it finds?

Other than that, about the only advice I can give would be a re-install :(

marko
9th October 2012, 12:10 AM
I found this but this is a negative answer to your question

http://nixcraft.com/centos-rhel-fedora/12292-how-recreate-var-lib-rpm-packages-scratch.html

... still looking

fedvasu
9th October 2012, 09:39 AM
Try,

# rpmdb --initdb --rebuilddb
And from now on, when you want to clear any of yums cache, use the "yum clean <arg>" command. yum doesn't put anything in /var/lib/rpm/, rpm does. You totally blew away your rpm database, which yum depends on.

yup Pablo , from now on i'll follow your advice but , your command didn't help , first of all only one major mode can be specified at a time.

rpmdb --initdb
rpmdb --rebuilddb

but thanks anyway.

glennzo
12th October 2012, 07:54 PM
you should probably start a new thread (and delete your post here). It's not a good idea to tack a different post onto an existing thread since it's a new question

Agreed, given that there is a thread here (http://forums.fedoraforum.org/showthread.php?t=284907) about the inability to run yum.