LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-29-2011, 07:35 AM   #16
spwnt
Member
 
Registered: Jun 2006
Distribution: Linux Mint/Debian/Arch
Posts: 78

Rep: Reputation: 12

when you close it prematurely the lock file stays there. it puts a lock on the program so that you don't run more than one instance of it at the same time. you have to remove the lock file.
 
Old 02-15-2012, 12:28 PM   #17
jhcr
LQ Newbie
 
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
An easy way of deleting the lock file is to open nautilus (the file browser) in root (gksudo nautilus), click on file system then navigate through the folders var/lib/dpkg.

Inside the folder dpkg should be a file called 'lock'. Send it to the rubbish bin. Problem solved.
 
Old 07-12-2016, 02:50 AM   #18
Fnatical
LQ Newbie
 
Registered: Jul 2016
Posts: 1

Rep: Reputation: Disabled
I had the same issue:

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

I tried searching for processes that were using it as advised in an earlier post by doing:

Code:
ps aux | grep apt
ps aux | grep ftp
Neither of those revealed the culprit.

I then noticed that I had Synaptic Package Manager open. Once I closed that and attempted sudo apt-get update it completed successfully.

Hopefully this helps!
 
Old 04-12-2019, 06:41 AM   #19
Mi82
Member
 
Registered: Nov 2015
Posts: 53

Rep: Reputation: Disabled
I'm having the same problem with:
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/)


If I find and kill apt, later I can apt-get update but it hangs at this stage:

Get:7 http://deb.debian.org/debian stretch/main DEP-11 64x64 Icons [6,804 kB]
0% [Working]

And it hangs here indefinitely.

I read elsewhere that one should NOT delete the lock (using rm), because it protects from worse things happening, but rather kill the Process. When I search for apt and ftp, there are processes with *progressive* five digit PIDs:

ps aux | grep apt
root 18031 0.0 0.0 4728 812 pts/0 S+ 13:19 0:00 grep apt
root@Workstation:/home/sunny# ps aux | grep apt
root 18033 0.0 0.0 4728 824 pts/0 R+ 13:19 0:00 grep apt
root@Workstation:/home/sunny# ps aux | grep apt
root 18035 0.0 0.0 4728 816 pts/0 S+ 13:19 0:00 grep apt
root@Workstation:/home/sunny# ps aux | grep apt
root 18086 0.0 0.0 4728 812 pts/0 S+ 13:33 0:00 grep apt

When I try to kill these:

killall apt* dpkg
apt*: no process found
dpkg: no process found

Any advice?

Last edited by Mi82; 04-12-2019 at 06:44 AM.
 
Old 04-12-2019, 06:57 AM   #20
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
@Mi82:

Please paste the output from the following command:

Code:
inxi -r
and the following information: your distro and version.

Also, reboot your machine and paste the output from the following command:

Code:
sudo apt-get update
 
Old 04-12-2019, 08:12 AM   #21
Mi82
Member
 
Registered: Nov 2015
Posts: 53

Rep: Reputation: Disabled
Hmm, no command inxi. I tried installing it and:

apt-get install inxi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package inxi


Inxi looks very useful. Is there another way I can get that info?
 
Old 04-12-2019, 08:35 AM   #22
Mi82
Member
 
Registered: Nov 2015
Posts: 53

Rep: Reputation: Disabled
I got it! I reverted my sources list from a backup. I had changed them to an online-generated version (Zuerich) because I was having trouble with errors in the old (the ones I just reverted to) sources list (below):


deb http://ftp.is.debian.org/debian/ stretch main non-free
deb-src http://ftp.is.debian.org/debian/ stretch main non-free

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

# stretch-updates, previously known as 'volatile'
deb http://ftp.is.debian.org/debian/ stretch-updates main
deb-src http://ftp.is.debian.org/debian/ stretch-updates main


I am now getting those errors again, but much preferable to the prior problem:
Ign:1 http://deb.debian.org/debian stretch InRelease
Ign:5 http://ftp.is.debian.org/debian stretch InRelease

I now have inxi:
inxi -r

Repos: Active apt sources in file: /etc/apt/sources.list
deb http://ftp.is.debian.org/debian/ stretch main non-free
deb-src http://ftp.is.debian.org/debian/ stretch main non-free
deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main
deb http://ftp.is.debian.org/debian/ stretch-updates main
deb-src http://ftp.is.debian.org/debian/ stretch-updates main
Active apt sources in file: /etc/apt/sources.list.d/base.list
deb http://deb.debian.org/debian/ stretch main

Last edited by Mi82; 04-12-2019 at 08:37 AM.
 
Old 04-12-2019, 09:00 AM   #23
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Some comments:

. Those "ign" output lines you are seeing are not errors. They mean that there are no changes in the pdiff index file so apt won't bother downloading it again.

https://askubuntu.com/questions/2945...apt-get-update

. /etc/apt/sources.list.d/base.list seems superfluous. You already have the main repo defined in the main list. I would delete that file.

. You would find a broader range of software available to you if you also specified contrib non-free for all the Debian repos.

See https://wiki.debian.org/SourcesList

. For readability and formatting reasons, you should paste all commands and output here on LQ using CODE tags (see https://www.linuxquestions.org/quest...og.php?b=36313) like this:

Code:
Hello, I am some output.
 
Old 04-12-2019, 10:41 AM   #24
Mi82
Member
 
Registered: Nov 2015
Posts: 53

Rep: Reputation: Disabled
Re:

Thank you!!
 
Old 04-12-2019, 10:42 AM   #25
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Mi82 View Post
Thank you!!
No problem. Is everything working ok now?
 
  


Reply



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: cannot get exclusive lock on /var/lib/rpm/Packages Raafi Fedora 3 03-06-2005 03:45 AM
error: cannot get exclusive lock on /var/lib/rpm/Packages orly Linux - Software 2 09-06-2004 07:13 AM
error:cannot get exclusive lock on /var/lib/rmp/packages mateka Linux - Newbie 1 06-26-2004 10:07 PM
error: cannot get exclusive lock on /var/lib/rpm/Packages error: cannot open Packages inward_eye Linux - Software 3 08-24-2003 03:07 PM
SIOCSIFFLAGS: Resource temporarily unavailable bleef Linux - Networking 2 05-14-2001 10:54 PM

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

All times are GMT -5. The time now is 06:23 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
Open Source Consulting | Domain Registration