Score:5

how to fix this : " waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)

it flag

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
Score:3
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.