locked out of s/ware modification

Asked by geoffcc

geoffcc1@geoffcc1-System-Product-Name:~$ sudo grep -R proxy /etc/apt/*
[sudo] password for geoffcc1:
geoffcc1@geoffcc1-System-Product-Name:~$ sudo fuser -vvv /var/lib/dpkg/lock
                     USER PID ACCESS COMMAND
/var/lib/dpkg/lock: root 2351 F.... dpkg
geoffcc1@geoffcc1-System-Product-Name:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
geoffcc1@geoffcc1-System-Product-Name:~$ uname -a
Linux geoffcc1-System-Product-Name 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:33:05 UTC 2012 i686 i686 i386 GNU/Linux
geoffcc1@geoffcc1-System-Product-Name:~$ sudo rm /var/lib/apt/lists/lock
geoffcc1@geoffcc1-System-Product-Name:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
geoffcc1@geoffcc1-System-Product-Name:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
geoffcc1@geoffcc1-System-Product-Name:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
geoffcc1@geoffcc1-System-Product-Name:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
geoffcc1@geoffcc1-System-Product-Name:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
geoffcc1@geoffcc1-System-Product-Name:~$ sudo rm -rf /var/lib/dpkg/updates
geoffcc1@geoffcc1-System-Product-Name:~$ sudo rm -rf /var/lib/dpkg/updates/*
geoffcc1@geoffcc1-System-Product-Name:~$ sudo rm -rf /var/lib/apt/lists
geoffcc1@geoffcc1-System-Product-Name:~$ sudo rm /var/cache/apt/*.bin
geoffcc1@geoffcc1-System-Product-Name:~$ mkdir /var/lib/apt/lists
mkdir: cannot create directory `/var/lib/apt/lists': Permission denied
geoffcc1@geoffcc1-System-Product-Name:~$ sudo mkdir /var/lib/apt/lists
geoffcc1@geoffcc1-System-Product-Name:~$ sudo mkdir /var/lib/apt/lists/partial
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get clean
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get autoclean
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get --purge autoremove
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?
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824
Ign http://archive.canonical.com precise InRelease
Ign http://archive.canonical.com natty InRelease
Ign http://archive.ubuntu.com precise InRelease
Ign http://archive.ubuntu.com precise-updates InRelease
Ign http://archive.ubuntu.com precise-backports InRelease
Get:1 http://archive.canonical.com precise Release.gpg [198 B]
Ign http://archive.ubuntu.com precise-security InRelease
Get:2 http://archive.ubuntu.com precise Release.gpg [198 B]
Get:3 http://archive.canonical.com natty Release.gpg [198 B]
Get:4 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:5 http://archive.ubuntu.com precise-backports Release.gpg [198 B]
Get:6 http://archive.canonical.com precise Release [7078 B]
Get:7 http://archive.ubuntu.com precise-security Release.gpg [198 B]
Get:8 http://archive.canonical.com natty Release [5916 B]
Get:9 http://archive.ubuntu.com precise Release [49.6 kB]
Get:10 http://archive.canonical.com precise/partner i386 Packages [4982 B]
Ign http://archive.canonical.com precise/partner TranslationIndex
Get:11 http://archive.ubuntu.com precise-updates Release [49.6 kB]
Get:12 http://archive.canonical.com natty/partner Sources [4093 B]
Get:13 http://archive.ubuntu.com precise-backports Release [49.6 kB]
Get:14 http://archive.ubuntu.com precise-security Release [49.6 kB]
Get:15 http://archive.ubuntu.com precise/main Sources [934 kB]
Ign http://archive.canonical.com precise/partner Translation-en
Get:16 http://archive.ubuntu.com precise/restricted Sources [5470 B]
Get:17 http://archive.ubuntu.com precise/universe Sources [5019 kB]
Get:18 http://archive.ubuntu.com precise/multiverse Sources [155 kB]
Get:19 http://archive.ubuntu.com precise/main i386 Packages [1274 kB]
Get:20 http://archive.ubuntu.com precise/restricted i386 Packages [8431 B]
Get:21 http://archive.ubuntu.com precise/universe i386 Packages [4796 kB]
Get:22 http://archive.ubuntu.com precise/multiverse i386 Packages [121 kB]
Get:23 http://archive.ubuntu.com precise/main TranslationIndex [3706 B]
Get:24 http://archive.ubuntu.com precise/multiverse TranslationIndex [2676 B]
Get:25 http://archive.ubuntu.com precise/restricted TranslationIndex [2596 B]
Get:26 http://archive.ubuntu.com precise/universe TranslationIndex [2922 B]
Get:27 http://archive.ubuntu.com precise-updates/main Sources [116 kB]
Get:28 http://archive.ubuntu.com precise-updates/restricted Sources [1379 B]
Get:29 http://archive.ubuntu.com precise-updates/universe Sources [27.7 kB]
Get:30 http://archive.ubuntu.com precise-updates/multiverse Sources [1058 B]
Get:31 http://archive.ubuntu.com precise-updates/main i386 Packages [294 kB]
Get:32 http://archive.ubuntu.com precise-updates/restricted i386 Packages [2439 B]
Get:33 http://archive.ubuntu.com precise-updates/universe i386 Packages [80.5 kB]
Get:34 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [2049 B]
Get:35 http://archive.ubuntu.com precise-updates/main TranslationIndex [74 B]
Get:36 http://archive.ubuntu.com precise-updates/multiverse TranslationIndex [71 B]
Get:37 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [71 B]
Get:38 http://archive.ubuntu.com precise-updates/universe TranslationIndex [73 B]
Get:39 http://archive.ubuntu.com precise-backports/main Sources [1346 B]
Get:40 http://archive.ubuntu.com precise-backports/restricted Sources [14 B]
Get:41 http://archive.ubuntu.com precise-backports/universe Sources [6873 B]
Get:42 http://archive.ubuntu.com precise-backports/multiverse Sources [1383 B]
Get:43 http://archive.ubuntu.com precise-backports/main i386 Packages [929 B]
Get:44 http://archive.ubuntu.com precise-backports/restricted i386 Packages [14 B]
Get:45 http://archive.ubuntu.com precise-backports/universe i386 Packages [6117 B]
Get:46 http://archive.ubuntu.com precise-backports/multiverse i386 Packages [999 B]
Get:47 http://archive.ubuntu.com precise-backports/main TranslationIndex [71 B]
Get:48 http://archive.ubuntu.com precise-backports/multiverse TranslationIndex [71 B]
Get:49 http://archive.ubuntu.com precise-backports/restricted TranslationIndex [70 B]
Get:50 http://archive.ubuntu.com precise-backports/universe TranslationIndex [72 B]
Get:51 http://archive.ubuntu.com precise-security/main Sources [21.1 kB]
Get:52 http://archive.ubuntu.com precise-security/restricted Sources [14 B]
Get:53 http://archive.ubuntu.com precise-security/universe Sources [7120 B]
Get:54 http://archive.ubuntu.com precise-security/multiverse Sources [713 B]
Get:55 http://archive.ubuntu.com precise-security/main i386 Packages [65.9 kB]
Get:56 http://archive.ubuntu.com precise-security/restricted i386 Packages [14 B]
Get:57 http://archive.ubuntu.com precise-security/universe i386 Packages [17.4 kB]
Get:58 http://archive.ubuntu.com precise-security/multiverse i386 Packages [1394 B]
Get:59 http://archive.ubuntu.com precise-security/main TranslationIndex [73 B]
Get:60 http://archive.ubuntu.com precise-security/multiverse TranslationIndex [71 B]
Get:61 http://archive.ubuntu.com precise-security/restricted TranslationIndex [70 B]
Get:62 http://archive.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get:63 http://archive.ubuntu.com precise/main Translation-en [726 kB]
Get:64 http://archive.ubuntu.com precise/multiverse Translation-en [93.4 kB]
Get:65 http://archive.ubuntu.com precise/restricted Translation-en [2395 B]
Get:66 http://archive.ubuntu.com precise/universe Translation-en [3341 kB]
Get:67 http://archive.ubuntu.com precise-updates/main Translation-en [134 kB]
Get:68 http://archive.ubuntu.com precise-updates/multiverse Translation-en [912 B]
Get:69 http://archive.ubuntu.com precise-updates/restricted Translation-en [798 B]
Get:70 http://archive.ubuntu.com precise-updates/universe Translation-en [47.7 kB]
Get:71 http://archive.ubuntu.com precise-backports/main Translation-en [731 B]
Get:72 http://archive.ubuntu.com precise-backports/multiverse Translation-en [422 B]
Get:73 http://archive.ubuntu.com precise-backports/restricted Translation-en [14 B]
Get:74 http://archive.ubuntu.com precise-backports/universe Translation-en [4352 B]
Get:75 http://archive.ubuntu.com precise-security/main Translation-en [33.5 kB]
Get:76 http://archive.ubuntu.com precise-security/multiverse Translation-en [587 B]
Get:77 http://archive.ubuntu.com precise-security/restricted Translation-en [14 B]
Get:78 http://archive.ubuntu.com precise-security/universe Translation-en [11.9 kB]
Fetched 17.6 MB in 44s (396 kB/s)
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?
geoffcc1@geoffcc1-System-Product-Name:~$ sudo dpkg --configure -a
dpkg: error: dpkg status database is locked by another process
geoffcc1@geoffcc1-System-Product-Name:~$ sudo dpkg --clear -avail
dpkg: error: unknown option --clear

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through `less' or `more' !
geoffcc1@geoffcc1-System-Product-Name:~$ sudo dpkg --clear-avail
dpkg: error: dpkg status database is locked by another process
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get -f install
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?
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get --fix-missing install
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?
geoffcc1@geoffcc1-System-Product-Name:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824 && sudo apt-get di
Ign http://archive.canonical.com precise InRelease
Ign http://archive.canonical.com natty InRelease
Ign http://archive.ubuntu.com precise InRelease
Ign http://archive.ubuntu.com precise-updates InRelease
Ign http://archive.ubuntu.com precise-backports InRelease
Ign http://archive.ubuntu.com precise-security InRelease
Hit http://archive.canonical.com precise Release.gpg
Get:1 http://archive.ubuntu.com precise Release.gpg [198 B]
Get:2 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:3 http://archive.ubuntu.com precise-backports Release.gpg [198 B]
Hit http://archive.canonical.com natty Release.gpg
Get:4 http://archive.ubuntu.com precise-security Release.gpg [198 B]
Hit http://archive.canonical.com precise Release
Get:5 http://archive.ubuntu.com precise Release [49.6 kB]
Hit http://archive.canonical.com natty Release
Hit http://archive.canonical.com precise/partner i386 Packages
Ign http://archive.canonical.com precise/partner TranslationIndex
Hit http://archive.canonical.com natty/partner Sources
Get:6 http://archive.ubuntu.com precise-updates Release [49.6 kB]
Get:7 http://archive.ubuntu.com precise-backports Release [49.6 kB]
Get:8 http://archive.ubuntu.com precise-security Release [49.6 kB]
Get:9 http://archive.ubuntu.com precise/main Sources [934 kB]
Ign http://archive.canonical.com precise/partner Translation-en
Get:10 http://archive.ubuntu.com precise/restricted Sources [5470 B]
Get:11 http://archive.ubuntu.com precise/universe Sources [5019 kB]
Get:12 http://archive.ubuntu.com precise/multiverse Sources [155 kB]
Get:13 http://archive.ubuntu.com precise/main i386 Packages [1274 kB]
Get:14 http://archive.ubuntu.com precise/restricted i386 Packages [8431 B]
Get:15 http://archive.ubuntu.com precise/universe i386 Packages [4796 kB]
Get:16 http://archive.ubuntu.com precise/multiverse i386 Packages [121 kB]
Hit http://archive.ubuntu.com precise/main TranslationIndex
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise/restricted TranslationIndex
Hit http://archive.ubuntu.com precise/universe TranslationIndex
Get:17 http://archive.ubuntu.com precise-updates/main Sources [116 kB]
Get:18 http://archive.ubuntu.com precise-updates/restricted Sources [1379 B]
Get:19 http://archive.ubuntu.com precise-updates/universe Sources [27.7 kB]
Get:20 http://archive.ubuntu.com precise-updates/multiverse Sources [1058 B]
Get:21 http://archive.ubuntu.com precise-updates/main i386 Packages [294 kB]
Get:22 http://archive.ubuntu.com precise-updates/restricted i386 Packages [2439 B]
Get:23 http://archive.ubuntu.com precise-updates/universe i386 Packages [80.5 kB]
Get:24 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [2049 B]
Hit http://archive.ubuntu.com precise-updates/main TranslationIndex
Hit http://archive.ubuntu.com precise-updates/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise-updates/restricted TranslationIndex
Hit http://archive.ubuntu.com precise-updates/universe TranslationIndex
Get:25 http://archive.ubuntu.com precise-backports/main Sources [1346 B]
Get:26 http://archive.ubuntu.com precise-backports/restricted Sources [14 B]
Get:27 http://archive.ubuntu.com precise-backports/universe Sources [6873 B]
Get:28 http://archive.ubuntu.com precise-backports/multiverse Sources [1383 B]
Get:29 http://archive.ubuntu.com precise-backports/main i386 Packages [929 B]
Get:30 http://archive.ubuntu.com precise-backports/restricted i386 Packages [14 B]
Get:31 http://archive.ubuntu.com precise-backports/universe i386 Packages [6117 B]
Get:32 http://archive.ubuntu.com precise-backports/multiverse i386 Packages [999 B]
Hit http://archive.ubuntu.com precise-backports/main TranslationIndex
Hit http://archive.ubuntu.com precise-backports/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise-backports/restricted TranslationIndex
Hit http://archive.ubuntu.com precise-backports/universe TranslationIndex
Get:33 http://archive.ubuntu.com precise-security/main Sources [21.1 kB]
Get:34 http://archive.ubuntu.com precise-security/restricted Sources [14 B]
Get:35 http://archive.ubuntu.com precise-security/universe Sources [7120 B]
Get:36 http://archive.ubuntu.com precise-security/multiverse Sources [713 B]
Get:37 http://archive.ubuntu.com precise-security/main i386 Packages [65.9 kB]
Get:38 http://archive.ubuntu.com precise-security/restricted i386 Packages [14 B]
Get:39 http://archive.ubuntu.com precise-security/universe i386 Packages [17.4 kB]
Get:40 http://archive.ubuntu.com precise-security/multiverse i386 Packages [1394 B]
Hit http://archive.ubuntu.com precise-security/main TranslationIndex
Hit http://archive.ubuntu.com precise-security/multiverse TranslationIndex
Hit http://archive.ubuntu.com precise-security/restricted TranslationIndex
Hit http://archive.ubuntu.com precise-security/universe TranslationIndex
Hit http://archive.ubuntu.com precise/main Translation-en
Hit http://archive.ubuntu.com precise/multiverse Translation-en
Hit http://archive.ubuntu.com precise/restricted Translation-en
Hit http://archive.ubuntu.com precise/universe Translation-en
Hit http://archive.ubuntu.com precise-updates/main Translation-en
Hit http://archive.ubuntu.com precise-updates/multiverse Translation-en
Hit http://archive.ubuntu.com precise-updates/restricted Translation-en
Hit http://archive.ubuntu.com precise-updates/universe Translation-en
Hit http://archive.ubuntu.com precise-backports/main Translation-en
Hit http://archive.ubuntu.com precise-backports/multiverse Translation-en
Hit http://archive.ubuntu.com precise-backports/restricted Translation-en
Hit http://archive.ubuntu.com precise-backports/universe Translation-en
Hit http://archive.ubuntu.com precise-security/main Translation-en
Hit http://archive.ubuntu.com precise-security/multiverse Translation-en
Hit http://archive.ubuntu.com precise-security/restricted Translation-en
Hit http://archive.ubuntu.com precise-security/universe Translation-en
Fetched 13.2 MB in 37s (352 kB/s)
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?
geoffcc1@geoffcc1-System-Product-Name:~$

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sam_ (and-sam) said :
#1

> E: Unable to lock the administration directory (/var/lib/dpkg/), ***is another process using it***?

Did you follow Step 3?
https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure#Step_3

When working from terminal please make sure there is no other package management GUI running, e.g. software-center, update-manager, software-sources, synaptic ...

When there is no package management GUI running, please post output of:
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Try:

sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a

HTH

Revision history for this message
geoffcc (geoffcc1) said :
#3

On Tue, 2012-06-26 at 14:21 +0000, actionparsnip wrote:
> Your question #201464 on apt in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/apt/+question/201464
>
> actionparsnip proposed the following answer:
> Try:
>
> sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a
>
> HTH
>
Thanks your help. Sorry to be a newbie.

What I get from above action is:

dpkg: error: cannot scan updates directory `/var/lib/dpkg/updates/': No
such file or directory

grateful your comments pls.

Geoffcc

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#4

This seems to be the problem:

USER PID ACCESS COMMAND
/var/lib/dpkg/lock: root 2351 F.... dpkg

So you need to kill process 2351 that is running as root and that is using dpkg....

Run this command:

sudo kill -9 2351

Then CLOSE all package management utilities.

Then resend the Terminal output from this procedure:

https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure

Revision history for this message
geoffcc (geoffcc1) said :
#5

Thanks for help guys. No luck. Now going to employ the last resort of the noob. The God switch followed by relaod!

Can you help with this problem?

Provide an answer of your own, or ask geoffcc for more information if necessary.

To post a message you must log in.