LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2011, 06:15 PM   #1
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Rep: Reputation: 19
What does this mean: ...exclusive lock on the packaging backend.... ???


As I have been trying to perform updates, and most recently, an Adobe Flash plugin update for my Firefox, I have gotten the following messages:

(in gui)
Quote:
Cannot get the exclusive lock on the packaging backend.
Please close any other legacy packaging tools that may be open.

(in terminal)
Quote:
E: Could not get lock /var/lib/dpkg/lock - open (Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Can someone explain this and help me to remedy it?
 
Old 09-15-2011, 06:32 PM   #2
thezerodragon
Member
 
Registered: Apr 2009
Location: Paris, France
Distribution: Fedora 12 Constantine
Posts: 142

Rep: Reputation: 44
Just a guess

Dear Mr. Neal,

I am not familiar with Kubuntu, but it appears as if another service is running in the background checking for updates. Linux ensures only one such program at a time has access to the system. I use Fedora KDE and I prefer to use 'yum' from the command line instead of allowing KPackageKit to check for updates. When I try to rum 'yum' while KPK is running, I get a similar error message. I then use the system monitor to isolate and kill KPackageKit, and then I am able to "free up" the lock. I hope this is helpful.
 
1 members found this post helpful.
Old 10-01-2011, 07:20 PM   #3
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Please help me
 
Old 10-01-2011, 07:36 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450
Quote:
Originally Posted by Bhakta Neal View Post
Please help me
As already mentioned, the error means that there is already another instance of synaptic or dpkg running. Make sure that there is only one instance of the package manager running.

If you are not sure which program has the lock then issue:
Code:
sudo lsof /var/lib/dpkg/lock
This will tell you which program is currently using the lock-file exclusively.
 
1 members found this post helpful.
Old 10-01-2011, 07:54 PM   #5
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Thanks.
I am so noob.
I followed your instructions, I am not sure if this is right:

Quote:
bhakta@Krishna-PC:~$ sudo lsof /var/lib/dpkg/lock
[sudo] password for bhakta:
bhakta@Krishna-PC:~$ sudo lsof /var/lib/dpkg/lock
bhakta@Krishna-PC:~$
 
Old 10-01-2011, 08:07 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450
Quote:
Originally Posted by Bhakta Neal View Post
Thanks.
I am so noob.
I followed your instructions, I am not sure if this is right:
Looks fine so far. You should have no trouble to open Synaptic package manager. If it still fails then it might be a permission (?) issue. In this case post the output of
Code:
ls -ld /var/lib/dpkg/
ls -l /var/lib/dpkg/lock
But that is just a guess.
 
1 members found this post helpful.
Old 10-02-2011, 02:52 AM   #7
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Thanks!

The result:

Quote:
bhakta@Krishna-PC:~$ ls -ld /var/lib/dpkg/
drwxr-xr-x 8 root root 4096 2011-09-20 21:17 /var/lib/dpkg/
bhakta@Krishna-PC:~$ ls -l /var/lib/dpkg/lock
-rw-r----- 1 root root 0 2011-09-20 21:17 /var/lib/dpkg/lock
 
Old 10-02-2011, 09:46 AM   #8
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450
Quote:
Originally Posted by Bhakta Neal View Post
Thanks!

The result:
Ok, once more this looks right. You should be able to start the package manager. If it still fails then post
the output of:
Code:
ps -e | grep 'synapt.*\|apt.*\|dpkg'
 
Old 10-05-2011, 08:51 AM   #9
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Looks like nothing happened

Quote:
bhakta@Krishna-PC:~$ ps -e | grep 'synapt.*\|apt.*\|dpkg'
bhakta@Krishna-PC:~$
 
Old 10-05-2011, 09:11 AM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450
Quote:
Originally Posted by Bhakta Neal View Post
Looks like nothing happened
That also indicates that the package manager should be able to start.
You are performing the update as root, right? I.e., try running
Code:
sudo aptitude search flash
and post the output.
One last thing I can think of as possible error source is that there might be an extended flag set on the directory and/or file. Post the output of
Code:
sudo lsattr -d /var/lib/dpkg/
sudo lsattr /var/lib/dpkg/
PS:
When you post command line output then please use code-tags. Don't use the quick answer field at the end of the thread. Click on the 'Post reply' button instead. You can then insert [code][/code] tags by clicking on # symbol.
 
Old 10-06-2011, 12:39 AM   #11
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Hi, thanks for all your time.

Results of outputs requested in post #10, in order:


Code:
bhakta@Krishna-PC:~$ sudo aptitude search flash
[sudo] password for bhakta: 
sudo: aptitude: command not found
then

Code:
bhakta@Krishna-PC:~$ sudo lsattr -d /var/lib/dpkg/
-----------------e- /var/lib/dpkg/
and

Code:
bhakta@Krishna-PC:~$ sudo lsattr /var/lib/dpkg/
-----------------e- /var/lib/dpkg/format
-----------------e- /var/lib/dpkg/statoverride-old
-----------------e- /var/lib/dpkg/available
-----------------e- /var/lib/dpkg/parts
--------------I--e- /var/lib/dpkg/info
-----------------e- /var/lib/dpkg/status-old
-----------------e- /var/lib/dpkg/statoverride
-----------------e- /var/lib/dpkg/lock
-----------------e- /var/lib/dpkg/cmethopt
-----------------e- /var/lib/dpkg/updates
-----------------e- /var/lib/dpkg/diversions-old
-----------------e- /var/lib/dpkg/alternatives
-----------------e- /var/lib/dpkg/tmp.ci
-----------------e- /var/lib/dpkg/status
-----------------e- /var/lib/dpkg/diversions
-----------------e- /var/lib/dpkg/available-old
-----------------e- /var/lib/dpkg/triggers
Thanks!
 
Old 10-06-2011, 07:40 AM   #12
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450
Quote:
Originally Posted by Bhakta Neal View Post
Code:
bhakta@Krishna-PC:~$ sudo aptitude search flash
[sudo] password for bhakta: 
sudo: aptitude: command not found
Hm, this does not look right. It seems that you do not have aptitude installed. But you said that you are using Kunbuntu. I am not familiar with that particular distro. So I do not know if it uses some alternative to aptitude. Well, in any case this should (hopefully) work:
Code:
sudo apt-get update
sudo apt-get upgrade
 
Old 10-06-2011, 07:47 AM   #13
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Perhaps in a previous instance, synaptic or apt hasnt exited gracefully, and there is a stale lock file?
In which case, the lock file can be safely removed, as it will be created again when synaptic/apt is next run.

t'be sure t'be sure, reboot, that will make sure there are no processes accessing the lock file, if the problem still persists, remove the lock file, and try again.
 
Old 10-06-2011, 05:16 PM   #14
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
Hey fuk,

While performing the suggestions in post #12, I saw this after the 'update' command:

Code:
234 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 233 MB/233 MB of archives.
After this operation, 520 kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main dpkg amd64 1.16.0~ubuntu7.1 [1,915 kB]
0% [1 dpkg 1,703 kB/1,915 kB 88%]                                                                                     82.9 kB/s 46min 32s^
Cbhakta@Krishna-PC:~$
It seems that there indeed is a locked up file, and the upgrade process is stalled. It has been stuck for about 10 min (with good www connection).
 
Old 10-06-2011, 05:17 PM   #15
Bhakta Neal
Member
 
Registered: Jul 2010
Location: Big Island, Hawaii
Distribution: Kubuntu10.04
Posts: 248

Original Poster
Rep: Reputation: 19
I do not know how to remove or unlock the locked file...
 
  


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
Unable to get exclusive lock mbs Linux - Newbie 4 06-07-2009 04:03 PM
cannot get exclusive lock Enochs Fedora 6 09-16-2007 11:22 AM
Cannot get exclusive lock apokryphos Linux - Newbie 3 12-02-2004 08:22 AM
exclusive lock on cd burning rosscopeeko Red Hat 2 09-01-2003 02:22 PM
exclusive lock on cd burning rosscopeeko Linux - Software 0 08-30-2003 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:11 PM.

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