PDA

View Full Version : Broken YUM



griffinmt
5th November 2012, 09:58 PM
For some reason, yum is broken (F17 desktop) and gives an error about a bad DB.
Since yum is how updates etc are fixed, how do I go about fixing (delete/reinstall etc) yum :dis:

---------- Post added at 03:58 PM ---------- Previous post was at 01:23 PM ----------

Now I am by the failed system, this is what I get.



error: rpmdb: BDB0113 Thread/process 721/3077977920 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:


This is what I find in /var/lib/rpm.


[root@jan rpm]# ls
Basenames __db.002 Group Obsoletename Requirename Triggername
Conflictname __db.003 Installtid Packages Sha1header
__db.001 Dirnames Name Providename Sigmd5

marko
5th November 2012, 10:40 PM
rm -f /var/lib/rpm/__db*

rpm --rebuilddb
Note the double underscore the first command before the "db*". All that should be run as root user

sidebrnz
5th November 2012, 10:46 PM
With Linux, man is your friend. Specifically this:

man yum

Run this as root:

yum clean rpmdb

That should clean up your database. If you still have trouble:

yum clean all

may be needed, but try cleaning just the DB first; no need to use a bigger hammer than you need.

griffinmt
6th November 2012, 12:18 AM
I tried the clean options but I got the same results. Tomorrow I will delete the __db files then try it again. Thanks

sea
6th November 2012, 12:35 AM
I guess

yum makecache

doesnt have an effect either, right?

griffinmt
6th November 2012, 02:53 AM
I'll try the makecache tomorrow too.
Thanks.

jozze
15th November 2012, 06:13 PM
I ran into it this morning, also. Found out it exists since F15 (see: <https://bugzilla.redhat.com/show_bug.cgi?id=739492>) Bug description is almost exact match, why the hell the bug was closed in F16?

@Marko: Lepa hvala za nasvet, prijatelj!

I followed nice advice from Marko, killed some files as he instructs. All my previous attempts were kicks in the darkness.

rm -f /var/lib/rpm/__db*

Then I issued:

rpm --rebuilddb

And:

yum clean all (to be sure everything really cleans up)

Finally:

yum makecache

And for test, I ran:

yum --skip-broken (as always!)

and it worked! Well, I lost 6 hours for this to learn the hard way.

On my way through darkness, I went even looking back in my /var/log/yum.log. There was nothing wrong. According to it, I've installed/updated during last days (bigones & notables):
- latest available kernel until now (3.6.6.1, x86_64, nothing special added to it),
- KDE 4.9.2
- yumex 3.0.9 (irrelevant, I always run yum from terminal),
- yum-langpacks 0.3.0-3.fc17,
- createrepo_c-libs-0.1.11-1.fc17.x86_64,
- os-prober-1.56-1.fc17.x86_64,
- wine-1.5.16-1.fc17.x86_64,
- perl-core-5.14.3-217.fc17.x86_64,
- my yum --version gives this output:


3.4.3
Installed: rpm-4.9.1.3-7.fc17.x86_64 at 2012-07-03 13:20
Built : Fedora Project at 2012-05-07 10:05
Committed: Panu Matilainen <pmatilai at redhat.com> at 2012-05-07

Installed: yum-3.4.3-29.fc17.noarch at 2012-09-08 14:39
Built : Fedora Project at 2012-08-28 14:32
Committed: Zdenek Pavlas <zpavlas at redhat.com> at 2012-08-28

Installed: yum-plugin-aliases-1.1.31-4.fc17.noarch at 2012-07-03 19:58
Built : Fedora Project at 2012-01-26 20:48
Committed: James Antill <jamesfedora at project.org> at 2012-01-26

Installed: yum-plugin-fastestmirror-1.1.31-4.fc17.noarch at 2012-07-03 19:53
Built : Fedora Project at 2012-01-26 20:48
Committed: James Antill <jamesfedora at project.org> at 2012-01-26

The incriminated version of RPM from the bug above was 4.9.1.1-1at opening in F15 and 4.9.1.1-3 at closing in F16.
I normally run su in Konsole, as one thread (i7 allows me 8 independent threads). It would interesting which version of yum/rpm Griffin has.

If somebody wants my yum.log, I backed it up a copy before rebuilding databases.

samtuke
5th April 2013, 12:16 AM
Worked for me! Thanks @jozze