apt-get
, I saw the error message below:$ sudo apt-get install ibmonitor 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 saw there was another installation in progress via the Update Manager, but the Update Manager update had been running for many days without successfully completing. I couldn't cancel or kill the Update Manager update through the graphical user interface (GUI) for the Update Manager, so I checked for any process identifier (PID) associated with update-manager.
$ ps -ef | grep -i update-manager | grep -v grep jdoe 4339 1 0 2015 ? 00:02:24 /usr/bin/python /usr/bin/update-manager --no-focus-on-map jdoe 14331 1 0 Apr17 ? 00:01:21 /usr/bin/python /usr/lib/update-manager/check-new-release-gtk jdoe 25428 1 0 May01 ? 00:00:39 /usr/bin/python /usr/lib/update-manager/check-new-release-gtk
I killed all three of the processes I found associated with "update-manager", but that still did not allow me to successfully run apt-get.
$ kill -9 4339 $ sudo apt-get install ibmonitor 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? $ ps -ef | grep -i update-manager | grep -v grep jdoe 14331 1 0 Apr17 ? 00:01:21 /usr/bin/python /usr/lib/update-manager/check-new-release-gtk jdoe 25428 1 0 May01 ? 00:00:39 /usr/bin/python /usr/lib/update-manager/check-new-release-gtk $ kill -9 14331 $ kill -9 25428 $ ps -ef | grep -i update-manager | grep -v grep $ sudo apt-get install ibmonitor E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
I then checked to be sure there was no other instance of apt-get running, but saw none.
$ ps aux | grep apt-get | grep -v grep $
Since I had killed the processes I found associated with "update-manager"
with kill -9
, I figured there as a lock file remaining, since
I had terminated the processes abnormally. When I checked for the presence
of a lock
file in /var/lib/dpkg
, I found there was
one there.
$ ls /var/lib/dpkg/lock /var/lib/dpkg/lock
After I removed the lock file, I was still unable to successfully run apt-get.
$ sudo apt-get install ibmonitor E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. $
I then ran the sudo dpkg --configure -a
command as suggested in
the error message.
$ sudo dpkg --configure -a Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.2.0-92-generic Processing triggers for libgdk-pixbuf2.0-0 ... Setting up xserver-xorg-video-vmware (1:12.0.1-1ubuntu1.2) ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for libreoffice-common ... Setting up libdevmapper-event1.02.1 (2:1.02.48-4ubuntu7.4) ... Setting up libreoffice-help-en-gb (1:3.5.7-0ubuntu8) ... Setting up linux-image-generic (3.2.0.92.106) ... Setting up grub-pc (1.99-21ubuntu3.18) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing grub-pc (--configure): subprocess installed post-installation script returned error exit status 1 Processing triggers for libc-bin ... ldconfig deferred processing now taking place Setting up linux-generic (3.2.0.92.106) ... Setting up libreoffice-help-en-us (1:3.5.7-0ubuntu8) ... Setting up network-manager-gnome (0.9.4.1-0ubuntu2.5) ... Setting up upower (0.9.15-3git1ubuntu0.1) ... Setting up libreoffice-emailmerge (1:3.5.7-0ubuntu8) ... Setting up liblvm2app2.2 (2.02.66-4ubuntu7.4) ... Setting up udisks (1.0.4-5ubuntu2.2) ... Setting up usb-creator-common (0.2.38.3ubuntu0.1) ... Setting up usb-creator-gtk (0.2.38.3ubuntu0.1) ... Setting up libmono-system4.0-cil (2.10.8.1-1ubuntu2.3) ... Setting up libmono-sharpzip4.84-cil (2.10.8.1-1ubuntu2.3) ... Setting up libmono-posix4.0-cil (2.10.8.1-1ubuntu2.3) ... Setting up libmono-system-drawing4.0-cil (2.10.8.1-1ubuntu2.3) ... Setting up libmono-system-configuration4.0-cil (2.10.8.1-1ubuntu2.3) ... Setting up libmono-system-core4.0-cil (2.10.8.1-1ubuntu2.3) ... Setting up libmono-csharp4.0-cil (2.10.8.1-1ubuntu2.3) ... Setting up banshee (2.4.1-3ubuntu1~precise3) ... Setting up banshee-extension-soundmenu (2.4.1-3ubuntu1~precise3) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place Errors were encountered while processing: grub-pc $
I was then able to successfully run the apt-get
command, though
in this case the package I was attempting to install didn't exist; I didn't
think the ibmonitor package was already available, but I wanted to use
apt-get
to verify that was the case. I saw that there was no
existing package available for the utility.
$ sudo apt-get install ibmonitor Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package ibmonitor $