apt-get - cannot get exclusive lock on /var/lib/rpm/Packages

Place to discuss Fedora and/or Red Hat

apt-get - cannot get exclusive lock on /var/lib/rpm/Packages

Postby Maniaman » Mon Nov 07, 2005 8:04 pm

After doing an upgrade on most of the system using synaptic, I am no longer able to use apt-get from the command line, and synaptic will no longer load correctly.

When using apt-get fromt he command line I get this error and then it hangs.
warning: cannot get exclusive lock on /var/lib/rpm/Packages


Attempting to run synaptic causes it to opent he synaptic gui, but everything stays grayed out, and it basically hangs.

How would I fix this?
Maniaman
scripter
scripter
 
Posts: 94
Joined: Tue Mar 11, 2003 5:10 pm

Postby Void Main » Mon Nov 07, 2005 8:45 pm

What OS/version? What repos are you using? What packages were upgraded (check /var/cache/apt/archives)? The message you quote usually happens if either A) you are not root or B) another program has a lock on the database (rpm, apt, etc). Do a "ps auxwww | egrep 'rpm|apt'" and see what pops up. Kill any hung processes.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Mon Nov 07, 2005 10:12 pm

A) you are not root or


That is the only time I have ever seen this error.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Tue Nov 08, 2005 8:54 am

ZiaTioN wrote:
A) you are not root or


That is the only time I have ever seen this error.


It will also happen if you try and do more than one rpm command at a time other than just a query. The rpm command puts a lock on the RPM database when you do an erase, install, or update and if you try and run another rpm command while one of those are in progress you'll get that error. There have also been bugs in previous versions that wouldn't clean up the lock files properly which can cause it:

http://voidmain.is-a-geek.net/redhat/fe ... round.html
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Maniaman » Tue Nov 08, 2005 3:37 pm

Seems to be working now after doing a killall -9 apt-get and the stuff in the rpm bug workaround page.

edit: spoke too soon, the error popped up again, but stuff will install now.
Maniaman
scripter
scripter
 
Posts: 94
Joined: Tue Mar 11, 2003 5:10 pm


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 0 guests

cron