LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
 
Search this Thread
Old 03-27-2014, 04:48 PM   #1
Josh Hathcock
LQ Newbie
 
Registered: Sep 2012
Distribution: Centos, Fedora
Posts: 4

Rep: Reputation: Disabled
Cannot use Yum. Error with rpmdb?


I am running Centos 6.5. I run
Code:
sudo yum update
I get
Code:
rpmdb: Thread/process 16272/140241829988096 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
I have tried
Code:
sudo yum clean
sudo rm -f /var/lib/rpm/__db*
sudo rpm --rebuilddb
Removing the __db* files works.

However I then get this when I run
Code:
sudo yum update
Code:
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-comp
lete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package glib2.x86_64 0:2.26.1-3.el6 will be updated
---> Package glib2.x86_64 0:2.26.1-7.el6_5 will be an update
---> Package grep.x86_64 0:2.6.3-4.el6 will be updated
---> Package grep.x86_64 0:2.6.3-4.el6_5.1 will be an update
---> Package kernel.x86_64 0:2.6.32-431.11.2.el6 will be installed
---> Package selinux-policy-targeted.noarch 0:3.7.19-231.el6 will be updated
---> Package selinux-policy-targeted.noarch 0:3.7.19-231.el6_5.1 will be an upda
te
And I just get popped back out into prompt. Of course the rpm directory just gets filled with new __db* files. I noticed there is a .rpm.lock file there, which I attempted to remove as well, but it still doesn't work.

Somewhere in this process I also ran across
Code:
freeing read locks for locker rpm
Any ideas?

Last edited by Josh Hathcock; 03-27-2014 at 04:49 PM.
 
Old 03-27-2014, 06:55 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2015, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 15,076

Rep: Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879Reputation: 2879
Welcome to LQ.

As your text says, run # yum-complete-transaction

... But you may not be able to do that, unless `yum-utils' is already installed.
So please install "yum-utils" manually :
# rpm -Uvh yum-utils-1.1.30-14.el6.noarch.rpm
http://mirror.centos.org/centos/6.5/...el6.noarch.rpm

(( Or if all other yum related packages are updated :
# rpm -Uvh yum-utils-1.1.30-17.el6.noarch.rpm
http://mirror.centos.org/centos/6.5/...6_5.noarch.rpm ))

-

Last edited by knudfl; 03-27-2014 at 07:00 PM.
 
Old 03-27-2014, 08:11 PM   #3
Josh Hathcock
LQ Newbie
 
Registered: Sep 2012
Distribution: Centos, Fedora
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you for the reply. Indeed I wasn't able to install via yum, so I was able to install via rpm. Indeed yum-complete-transaction was successful, however now when I try to update I just get this
Code:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.solarvps.com
 * epel: epel.mirror.constant.com
 * extras: mirror.solarvps.com
 * remi: remi.mirrors.hostinginnederland.nl
 * rpmforge: repoforge.mirror.constant.com
 * updates: centos.aol.com
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package glib2.x86_64 0:2.26.1-3.el6 will be updated
---> Package glib2.x86_64 0:2.26.1-7.el6_5 will be an update
---> Package grep.x86_64 0:2.6.3-4.el6 will be updated
---> Package grep.x86_64 0:2.6.3-4.el6_5.1 will be an update
---> Package kernel.x86_64 0:2.6.32-431.11.2.el6 will be installed
---> Package selinux-policy-targeted.noarch 0:3.7.19-231.el6 will be updated
---> Package selinux-policy-targeted.noarch 0:3.7.19-231.el6_5.1 will be an update
---> Package yum-utils.noarch 0:1.1.30-14.el6 will be updated
---> Package yum-utils.noarch 0:1.1.30-17.el6_5 will be an update
It doesn't get any further along than that. I repeated my previous steps (deleting __db* files, rebuilding db, etc) and attempting to update again, and it just spits out the same results :/ No error or anything. Note that I ran yum-complete-transaction one more time and received this
Code:
Freeing read locks for locker 0x5: 16725/139639347144448
Freeing read locks for locker 0x7: 16725/139639347144448
Freeing read locks for locker 0x8: 16725/139639347144448
Freeing read locks for locker 0x9: 16725/139639347144448
Freeing read locks for locker 0xa: 16725/139639347144448
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.solarvps.com
 * epel: epel.mirror.constant.com
 * extras: mirror.solarvps.com
 * remi: remi.mirrors.hostinginnederland.nl
 * rpmforge: repoforge.mirror.constant.com
 * updates: centos.aol.com
Checking for new repos for mirrors
No unfinished transactions left.
Also .rpm.lock is back. Any thoughts?

*Edit*
Code:
yum search nodejs
returned
Code:
rpmdb: Thread/process 16748/140520319166208 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

Last edited by Josh Hathcock; 03-27-2014 at 08:25 PM.
 
Old 03-28-2014, 10:55 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,849

Rep: Reputation: 763Reputation: 763Reputation: 763Reputation: 763Reputation: 763Reputation: 763Reputation: 763
Those __db* files that you keep deleting are just the transaction lock storage. It is all of the other files in that directory that are the Berkeley DB files. The "Packages" file is the critical one. All the rest are built from that.

Try this:
Code:
cd /var/lib
tar -cvf rpmdb.tar rpm                # Save the current contents, just in case...
find rpm/* ! -name Packages -delete   # Remove everything except the Packages file
rpm --rebuilddb                       # Rebuild
That should leave you with a good database. In any event, you can always restore the tar file to get back to where you were.
 
Old 03-28-2014, 07:13 PM   #5
Josh Hathcock
LQ Newbie
 
Registered: Sep 2012
Distribution: Centos, Fedora
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the reply rknichols. Unfortunately that didn't work. I was able to successfully able to rebuild the db, but yum still just goes acts like it's going to update, and then just pops me out to prompt.
 
Old 03-28-2014, 10:41 PM   #6
John VV
Guru
 
Registered: Aug 2005
Posts: 14,144

Rep: Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913Reputation: 1913
as for fixing ?
unsure and possible not easily fixed ( if fixable )

but i think i know what caused this
Quote:
* base: mirror.solarvps.com
* epel: epel.mirror.constant.com
* extras: mirror.solarvps.com
* remi: remi.mirrors.hostinginnederland.nl
* rpmforge: repoforge.mirror.constant.com
* updates: centos.aol.com
RPMforge in incompatible with epel
and also incompatible with some things in remi

and remi is incompatible with the centos base and update -- CAUTION !!! is required

and a few packages in rpmfogre are incompatible with the cent base and update repos


remi and rpmfogre are normally DISABLED and only turned on for installing specific things

and the yum plugin "yum-priorities" is NOT installed and configured
that plugin is designed to help STOP the system from installing incompatible rpms

see the centOS wiki on installing software repos
http://wiki.centos.org/AdditionalResources/Repositories
and on that page is a link to the yum plugin
http://wiki.centos.org/PackageManagement/Yum/Priorities


installing rpms that conflict with other system critical programs can cause all kinds of problems


reinstalling might be required , while fixing rpmforge and remi can be done , it is not easy

Last edited by John VV; 03-28-2014 at 10:43 PM.
 
2 members found this post helpful.
Old 03-29-2014, 10:03 AM   #7
Josh Hathcock
LQ Newbie
 
Registered: Sep 2012
Distribution: Centos, Fedora
Posts: 4

Original Poster
Rep: Reputation: Disabled
[solved]

Thanks John VV, that makes sense. So I removed those repos and restarted my machine and voila! It works. Now, this is the first time I restarted my machine since the problem. I know, I know, that's the classic troubleshooting step, but I had ran across this problem before with another VPS which I did restart going through rebuilding the rpm db, and it didn't work. So I would be inclined to say that those repos were indeed the culprit. Thanks everyone!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: RPMDB altered outside of yum. newbie14 Linux - Newbie 17 01-07-2013 10:12 PM
Warning: RPMDB altered outside of yum jcky Linux - Newbie 4 01-08-2012 10:36 PM
yum rpmdb Pedroski Fedora 3 09-15-2011 10:22 AM
rpmDB error - How to solve problem? arindom Linux - Desktop 2 12-25-2006 06:06 AM
rpmdb error acid_kewpie Linux - General 0 02-02-2002 07:27 AM


All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration