7

I tried this:

moncef@moncef-Latitude-E7270:~$ sudo apt install tor
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)... 5s

This is my command history:

  109  sudo apt install ubuntu-restricted-extras
  110  sudo snap install qbittorrent-arnatious
  111  exit
  112  shutdown -h now
  113  systemctl poweroff -i
  114  sudo
  115  sudo apt install nmap
  116  sudo dpkg --configure -a
  117  sudo apt install nmap
  118  nmap
  119  history
  120  sudo apt remove ubuntu-restricted-extras
  121  sudo apt-get remove ubuntu-restricted-extras
  122  sudo apt remove ubuntu-restricted-extras
  123  sudo apt install tor
  124  sudo apt-get install tor
  125  sudo dpkg --configure -a
  126  ps aux | grep -i apt
  127  shutdown -h now
  128  sudo apt install ubuntu-restricted-extras
  129  sudo apt install tor
  130  history
  131  sudo apt install ubuntu-restricted-extras
  132  history
Jos
  • 29,224

1 Answers1

8

There is another apt instance running on your system with the PID (in this case) 3321. You could wait until it finishes or kill it if you really are in a hurry using this command:

sudo kill 3321

If it did not work then run this:

sudo kill -9 3321

Use whatever PID is given by the error instead of 3321.