Apt-get fun

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Apt-get fun

Postby heiowge » Sun Mar 09, 2014 8:41 pm

As superuser:

apt-get update & apt-get upgrade && apt-get clean && apt-get autoclean && apt-get autoremove
[1] 2244
Reading package lists... Done
Ign http://archive.ubuntu.com saucy InRelease
.
.
.
Fetched 540 kB in 6s (77.9 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?
Reading package lists... Error!
E: Problem renaming the file /var/cache/apt/srcpkgcache.bin.leMXQh to /var/cache/apt/srcpkgcache.bin - rename (2: No such file or directory)
E: Problem renaming the file /var/cache/apt/pkgcache.bin.hcWp2B to /var/cache/apt/pkgcache.bin - rename (2: No such file or directory)
E: The package lists or status file could not be parsed or opened.
[1]+ Exit 100 apt-get update


Any idea what to do? It's a fresh Mint Mate 32bit install of the LXF disc to the Dell machine in my sig (I managed to bugger up the last one so I had to reinstall).
i5 4440 3.1Ghz, Asus H87M-E motherboard, 8GB DDR3, 2GB DDR5 nVidia card, 2x500GB Seagate hd, Coolermaster 750W PSU running Mint 16 MATE and Win7

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd, Mint 14 MATE. Fan needs fixing.
User avatar
heiowge
LXF regular
 
Posts: 1906
Joined: Wed Feb 27, 2008 8:21 pm
Location: Cheshire, UK

Postby Dutch_Master » Sun Mar 09, 2014 11:20 pm

Use lsof to see which process is keeping the lock file:
Code: Select all
lsof | grep /var/lib/dpkg/lock

Note the PID of the offending process and use the kill command to make sure it's there no more :twisted:

Now, as root, start aptitude. It should fire up w/o issues. Close it (q key, confirm with y) and re-issue the command you started this thread with :)
Dutch_Master
LXF regular
 
Posts: 2453
Joined: Tue Mar 27, 2007 1:49 am

Postby roseway » Mon Mar 10, 2014 7:21 am

By the way, there's no point in running apt-get autoclean after apt-get clean. The 'clean' command will have already deleted all the downloaded packages, so there will be nothing left to autoclean.
Eric
roseway
LXF regular
 
Posts: 450
Joined: Thu Jan 18, 2007 2:27 pm

Postby heiowge » Wed Mar 12, 2014 2:06 pm

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?
Reading package lists... Error!
E: Problem renaming the file /var/cache/apt/pkgcache.bin.pxPAAK to /var/cache/apt/pkgcache.bin - rename (2: No such file or directory)
W: You may want to run apt-get update to correct these problems
[1]+ Exit 100 apt-get update
[100]************** ~ # lsof | grep /var/lib/dpkg/locklsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.

Ok. I'm lost. Any help please? :?


PS. Roseway, I'll try and remember to change the string of commands next time. I normally just use the arrows to grab it.
i5 4440 3.1Ghz, Asus H87M-E motherboard, 8GB DDR3, 2GB DDR5 nVidia card, 2x500GB Seagate hd, Coolermaster 750W PSU running Mint 16 MATE and Win7

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd, Mint 14 MATE. Fan needs fixing.
User avatar
heiowge
LXF regular
 
Posts: 1906
Joined: Wed Feb 27, 2008 8:21 pm
Location: Cheshire, UK

Postby nelz » Wed Mar 12, 2014 7:39 pm

Do you have another process running, like an update checker or package manager, that might already be locking the file?

If not, what is the output from

Code: Select all
sudo ls -l /var/lib/dpkg
sudo ls -ld /var/lib/dpkg
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8525
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby heiowge » Wed Mar 12, 2014 8:31 pm

Just booted up. Here goes...


*******@*******:~ > sudo ls -l /var/lib/dpkg
[sudo] password for *******:
total 8164
drwxr-xr-x 2 root root 4096 Mar 12 11:43 alternatives
-rw-r--r-- 1 root root 1962491 Mar 12 14:02 available
-rw-r--r-- 1 root root 1962474 Mar 12 11:15 available-old
-rw-r--r-- 1 root root 8 Nov 28 14:52 cmethopt
-rw-r--r-- 1 root root 433 Mar 9 09:55 diversions
-rw-r--r-- 1 root root 468 Mar 9 09:55 diversions-old
drwxr-xr-x 2 root root 393216 Mar 12 14:02 info
-rw-r----- 1 root root 0 Mar 12 14:02 lock
drwxr-xr-x 2 root root 4096 Oct 4 08:24 parts
-rw-r--r-- 1 root root 163 Nov 28 15:49 statoverride
-rw-r--r-- 1 root root 1998530 Mar 12 14:02 status
-rw-r--r-- 1 root root 1998677 Mar 12 14:02 status-old
drwxr-xr-x 2 root root 4096 Mar 12 14:02 triggers
drwxr-xr-x 2 root root 4096 Mar 12 14:02 updates
*******@*******:~ > sudo ls -ld /var/lib/dpkg
drwxr-xr-x 7 root root 4096 Mar 12 14:02 /var/lib/dpkg
i5 4440 3.1Ghz, Asus H87M-E motherboard, 8GB DDR3, 2GB DDR5 nVidia card, 2x500GB Seagate hd, Coolermaster 750W PSU running Mint 16 MATE and Win7

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd, Mint 14 MATE. Fan needs fixing.
User avatar
heiowge
LXF regular
 
Posts: 1906
Joined: Wed Feb 27, 2008 8:21 pm
Location: Cheshire, UK

Postby heiowge » Wed Mar 12, 2014 8:32 pm

*******@*******:~ > lsof | grep /var/lib/dpkg/lock
[1]*******@*******:~ >
i5 4440 3.1Ghz, Asus H87M-E motherboard, 8GB DDR3, 2GB DDR5 nVidia card, 2x500GB Seagate hd, Coolermaster 750W PSU running Mint 16 MATE and Win7

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd, Mint 14 MATE. Fan needs fixing.
User avatar
heiowge
LXF regular
 
Posts: 1906
Joined: Wed Feb 27, 2008 8:21 pm
Location: Cheshire, UK

Postby heiowge » Wed Mar 12, 2014 8:37 pm

Ok. Did my wonderfully long string of update, upgrade etc.

all went well until...

Ign http://packages.linuxmint.com petra/upstream Translation-en_GB
Ign http://packages.linuxmint.com petra/upstream Translation-en
Fetched 115 kB in 32s (3,530 B/s)
Reading package lists... Done

And it hangs. 5 minutes now. :?
i5 4440 3.1Ghz, Asus H87M-E motherboard, 8GB DDR3, 2GB DDR5 nVidia card, 2x500GB Seagate hd, Coolermaster 750W PSU running Mint 16 MATE and Win7

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd, Mint 14 MATE. Fan needs fixing.
User avatar
heiowge
LXF regular
 
Posts: 1906
Joined: Wed Feb 27, 2008 8:21 pm
Location: Cheshire, UK


Return to Help!

Who is online

Users browsing this forum: guy and 2 guests