See terminal text. 'Waiting for cache lock' error. How to fix? I'm on Ubuntu 21.04

advait@advait-Bravo-15-A4DDR:~$ sudo apt install ubuntu-restricted-extras

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43843 (synaptic)

apt is currently running a process in the background and while doing so, it locks the file. You have started another process that also wants to access that file and the request to lock that file is denied. See if waiting a few minutes helps. Changing the automatic update configuration to check for updates less often may make this occasional problem disappear.

  • Software and Updates
    • updates tab
      • Automatically check for updates [frequency]

Reboot will probably fix this as well.

1 Like

Waiting did the trick. Thx! Someone else suggested stopping the Ubuntu Software app and Synaptic and that seemed to help.