LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) (https://www.linuxquestions.org/questions/linux-newbie-8/e-could-not-get-lock-var-lib-dpkg-lock-open-11-resource-temporarily-unavailable-360554/)

phreakshew 09-05-2005 07:36 PM

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
 
PLEASE HELP!

I goofed-- I was running apt-get upgrade but it was takiing 500,000 years because we are running dialup so I closed the application thinking it would cancel it. Unfortunately, now when I try to run apt-get I get:

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

I tried killall -w apt-get as root but I don't know how to kill dpkg- Any suggestions?

phreakshew 09-05-2005 08:11 PM

when I try: killall -w aptget I get: no process killed
I

craigevil 09-05-2005 08:27 PM

Look for apt and ftp in whatever System manager you use or in htop. Kill those processess.

phreakshew 09-05-2005 08:33 PM

do you mean in the Synaptic Package Manager? I can see apt and ftp in there- do I remove them and then reinstall? not sure how to kill them in the Manager-

craigevil 09-05-2005 09:53 PM

NO in the system manager.
If you are using Gnome Look for Gnome system monitor
If you are using KDE look for KDE System Guard

Or open a terminal and run htop

phreakshew 09-06-2005 04:20 AM

hey I don't know what I did but like 7 hours ago I was able somehow to run apt-get upgrade again and this time it started working soI just left it alone,,, it was fine until about halfway thru then thr modem shut off-? so, I was able to run apt-get --fix-missing and then apt-get update and it seems to be working-

Since I had let it do it's thing all evening I just now got to read the last post. I will file that knowledge along with my growing "how to do stuff in Linux" notebook-

Thanx 4 the info and the help!

grepfruit 01-20-2007 04:18 PM

Hello,
the problem is that Synaptics acquires the lock.

Grepfruit

tonypop 06-27-2008 09:29 AM

i have an apple when i turn it on theres a var lock on it so it goes to yaboot version 1.3.13 and it asks for a password but i forgot it how do i get through the lock. please help email me at tonypop@yahoo.com

raynel 07-22-2008 11:38 AM

sudo rm /var/lib/apt/lists/lock

niiati 11-23-2010 04:27 AM

solving lock problem in ubuntu
 
This worked for me in ubuntu and hence I guess it'll be helpful to all ubuntu users.

1. Go to System => System Monitor
2. On the system Monitor go to the Processes
3. Go to view and then choose all processes
4. This will then display the the apt-get process
5. Just end the process and then voila you are good to go.

Hope this works!

chaitya 11-30-2010 08:36 PM

If apt-get doesn't show up in the list of processes, here's a work around to fix this:
1. rm /var/lib/dpkg/lock
2. sudo dpkg --configure -a

archtoad6 02-10-2011 08:12 AM

Quote:

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
I just spent the better part of an hour dealing w/ this same error. Here is what I did:

N.B. I ran all these as root.
  1. Checked for "is another process using it?":
    Code:

    ps aux  | egrep -i 'apt|ftp|kpack|dpkg'  | less
  2. I killed them all anyway, just to be sure:
    Code:

    killall -9 apt* kpackage dpkg
    If you ever use synaptic (it's removed from my system), you should make that:
    Code:

    killall -9 apt* kpackage dpkg synaptic
  3. Having confirmed that there were no "rogue" pkg. managers running, I checked, removed, & rechecked the lock file:
    Code:

    ls -l /var/lib/dpkg/lock
    rm -f /var/lib/dpkg/lock
    ls -l /var/lib/dpkg/lock

  4. Finally, I ran my "fix":
    Code:

    aptitude safe-upgrade
    I say "my fix" because I am still a die-hard aptitude user -- Last time I looked Debian had deprecated apt-get; however, I have seen reports that apt-get is being resurrected. You will need to do the appropriate thing for the pkg. manager you are using.

Comments
My final success came running the above in a console (Ctrl-Alt-F6), not an X-term, e.g. Konsole inside KDE. However, I don't know for sure if that was necessary, as I was very frustrated when /var/lib/dpkg/lock seemed to reappear over & over, & ready to beboot the box; but I have no proof that I had followed my own #3 above, before I moved to the console. I saw advice on another forum to reboot the box, & tried the console 1st, before using more drastic measures -- an X restart (Ctrl-Alr-Bksp) or a full reboot.

I got into the mess trying to install google-chrome-stable using dpkg -i, I didn't think to try installing the d/l-ed .deb w/ aptitude.

LIAGOS 03-22-2011 07:37 AM

Been trying to get this fixed for the past two hours, after lockup of installation of flashplayer.

All the below commands are run as sudo su in the root account.

I fixed it by going through the following:
1> sudo updatedb
{ updating the file database }

2> kill -9 $(pidof dpkg)
3> kill -9 $(pidof synaptic)
4> kill -9 $(pidof apt-get)
5> locate lock | grep /var
{Search for any lock files. Prune the list looking for any single file called "lock"}

6> rm -rf /var/lib/dpkg/lock
{This will forcefully removed the locks}

7> apt-get upgrade
8> dpkg --configure -a
{I then re-ran this command, this then caused the previous broken packed to fail thus releasing the regeneration of the software lock.}

After doing this I reran the updatedb and locate lock | grep /var to ensure that the lock didn't come back.

I find now work..

This is another alternative.

Cheers, I hope this helps

farnescle 04-29-2011 08:16 AM

#rm /var/lib/dpkg/lock
#rm /var/cache/apt/archives/lock

Never3nd 07-29-2011 04:24 AM

Im new at this and having the same problem trying to download java6, I went thru the tutorial and downloaded the plugins, came to the license agreement but no where to click ok or type in accept. Then tryed to look for sun-java in the terminal came up with the E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable). I went and did every code ya'll said but dnt know if it worked. Anyway to see if I deleted it so I can try to reinstall. Thanks for ya'lls time.


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