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

Place to discuss Fedora and/or Red Hat
Post Reply
Maniaman
scripter
scripter
Posts: 94
Joined: Tue Mar 11, 2003 5:10 pm

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

Post by 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?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by 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.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by 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.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by 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

Maniaman
scripter
scripter
Posts: 94
Joined: Tue Mar 11, 2003 5:10 pm

Post by 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.

Post Reply