Linux Blog

Yum Messed Up

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 10:05 am on Monday, November 16, 2009

So, this morning, when I got to work and booted up, I noticed something was wrong. My machine was not running as usual. It turns out, packagekit was sitting there being a general pain. I just wanted to look busy, so I killed the process. Turns out that wasn’t such a good idea, since it didn’t finish doing whatever it was doing and caused an ugly error like this:

rpmdb: Thread/process 28373/3077981888 failed: Thread died in Berkeley DB library
error: db4 error(-30975) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 – (-30975)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

rpmdb: Thread/process 28373/3077981888 failed: Thread died in Berkeley DB library
error: db4 error(-30975) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 – (-30975)

Naturally, I tried using rpm, do try and fix things, since it indicated something to do with a database I tried:

[owen@linuxblog ~]$ sudo rpm –justdb
rpm: –justdb may only be specified during package installation and erasure
[owen@linuxblog ~]$ sudo rpm –rebuilddb
rpmdb: Thread/process 28373/3077981888 failed: Thread died in Berkeley DB library
error: db4 error(-30975) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 – (-30975)

Well, it turns out that those options don’t work, and the rebuilddb gave an error about the db4 being corrupt. Well, I decided to go into /var/lib/rpm as the other error had that directory and found the db4 files. Running db45_recover sounded like it might work, so I gave it a shot.

[owen@linuxblog rpm]$ db45_recover -h /var/lib/rpm/
db45_recover: unlink: /var/lib/rpm/__db.003: Permission denied
db45_recover: unlink: /var/lib/rpm/__db.004: Permission denied
db45_recover: unlink: /var/lib/rpm/__db.000: Permission denied
db45_recover: unlink: /var/lib/rpm/__db.002: Permission denied
db45_recover: unlink: /var/lib/rpm/__db.001: Permission denied
db45_recover: /var/lib/rpm/log.0000000001: log file unreadable: Permission denied
db45_recover: PANIC: Permission denied
db45_recover: DB_ENV->log_newfh: 1: DB_RUNRECOVERY: Fatal error, run database recovery
db45_recover: dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery

That’s right,you need to be root for this bad boy:

[owen@linuxblog rpm]$ sudo db45_recover -h /var/lib/rpm/

The above seemed to fix it for now. I guess next time I’ll think about it more before I start slaying processes on a Monday morning.

Fedora 9 Thunderbird Update Fix

Filed under: Linux Software — TheLinuxBlog.com at 12:01 am on Wednesday, January 14, 2009

Fedora 9 Thunderbird
While updating a Fedora 9 installation I ran across an error. The error was with the Mozilla Thunderbird package that I use on a regular basis.
The error looked like this:

Running Transaction
Updating : thunderbird 1/2
Error unpacking rpm package thunderbird-2.0.0.19-1.fc9.i386
error: unpacking of archive failed on file /usr/lib/thunderbird-2.0.0.19/dictionaries: cpio: rename

Obviously any fix that I implemented couldn’t loose my mail. The problem was with the dictionaries more specifically the /usr/lib/thunderbird-2.0.0.19/dictionaries file. The error is not very specific but lets us know its having trouble unpacking the archive and ends with cpio: rename. So here is what I did to solve the problem:

cd /usr/lib/thunderbird-2.0.0.19/
sudo mv dictionaries dictionaries-old

Thunderbird data is stored in ~/.thunderbird it is advisable you make a backup of your mail if it is that important to you. I didn’t since this directory is a library directory and all of my mail can be downloaded again with imap. If you use pop you may want to consider doing a backup. After doing this it fixed Thunderbird and I’m all up to date. Horray!

Let me know if it worked for you and I’ll let you all know if there are any problems.

Getting a Hand With Bash

Filed under: General Linux — TheLinuxBlog.com at 8:27 am on Wednesday, October 1, 2008

If you use the bash shell, or as many know it the terminal on a regular basis then there is a package that you can install that will make your life a whole lot easier. Firstly I’ll tell you a little bit more about it.
When I first started using Linux a friend told me to install this package. I never really understood what it exactly did, but using the terminal was a whole lot easier then using the command prompt in Windows. I couldn’t explain it but things just worked. Features that were missing from Dos were there. There was awesome auto completion that knew what I wanted to type. Over the years I became more accustomed to using Linux and the Bash shell. I upgraded hardware, changed distributions and never really noticed what I was missing out on. The other day I was thinking, wouldn’t it be nice if I could press tab and this would auto complete. Then it hit me, the package my friend had told me to install when I first was starting out. The package happened to be exactly for this purpose. Since I was a novice and he was helping me out I didn’t really have the time to ask about the details of every single package, so here I am now letting you in on a little secret. (Read on …)

A few things you may not know about YUM

Filed under: Linux Software — TheLinuxBlog.com at 3:14 pm on Tuesday, July 15, 2008

Yum stands for “YellowDog Updater Modified”

Yum is a standard way to update multiple distributions.

The openSUSE build repository uses the yum updating system

Yum was written in Python.

If you install the yum-utils package you can download yum rpm packages by running:

yumdownloader –source yum

There are graphical front ends to YUM

Yum is maintained by the Linux@Duke project, thats right the basketball team you love to hate: The Blue Devils.