0

I'm unable to remove lock from dpkg, and it seems docker-ce installation was stopped midway

$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
$ sudo apt install aptitude
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?
$ sudo rm -R /var/lib/dpkg/lock
$ sudo rm /var/lib/dpkg/lock
rm: cannot remove '/var/lib/dpkg/lock': No such file or directory
$ sudo rm /var/lib/dpkg/lock
rm: cannot remove '/var/lib/dpkg/lock': No such file or directory
$ sudo rm /var/lib/apt/lists/lock
rm: cannot remove '/var/lib/apt/lists/lock': No such file or directory
$ sudo dpkg --configure -a
Setting up docker-ce (17.06.2~ce-0~ubuntu) ...
^Cdpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script was interrupted
Errors were encountered while processing:
 docker-ce

I have deleted lock files, but I get the same message. Using Ubuntu 16.04. I have to do a force stop because it stays here forever. And when i run dpkg -i /path/to/package.deb the output is

arton@arton-Latitude-E6230:~$ sudo dpkg -i /home/arton/Downloads/amd64/docker.io_1.12.6-0ubuntu1~16.04.‌​1A~4.2.0.20170324195‌​1_amd64.deb 
[sudo] password for arton: 
dpkg: error: dpkg status database is locked by another process
George Udosen
  • 35,970
  • 13
  • 99
  • 121
  • Take a look at this - https://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process – vishnu narayanan Sep 19 '17 at 07:07
  • 1
    Try "ps aux | grep apt"and kill the process using the process number. Try passing -9 if normall kill doesn't work. – vishnu narayanan Sep 19 '17 at 07:08
  • Does this answer your question? [Removed lock after "could not get lock", now I get "post installation script was interrupted"](https://askubuntu.com/questions/956977/removed-lock-after-could-not-get-lock-now-i-get-post-installation-script-was) – karel Feb 20 '22 at 01:42

0 Answers0