Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 476  / 1 Year ago, fri, april 28, 2023, 6:11:53

I tried to install restricted extras and vlc by entering the following code:


sudo apt install ubuntu-restricted-extras && sudo apt install vlc

I then accidentally terminated the process and now, whenever I try to install anything (anything at all), I get the following recurring message:


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

I tried to stop the process by typing:


kill -9 16338 

but was unsuccessful. Does anybody have any ideas on how I can kill the process and restore the ability to install what I want?


More From » apt

 Answers
4

The lock at /var/lib/dpkg/lock-frontend was invoked by apt the front end for dpkg ... The reason is to prevent two instances or more of dpkg running at the same time as this would caus problems.


Removing the lock at /var/lib/dpkg/lock-frontend in some cases will allow such a problem to happen if the back-end i.e. dpkg is still running which it might be. It is only done as a last resort if the problem persists after rebooting your system.


If a user waits for some time the lock will be removed automatically when it is safe to run dpkg or apt once again without causing problems.


process 16338 (apt) is already dead. You killed it when you terminated the process assuming you pressed ( Ctrl + c ) or just closed the terminal window.


So I would advise you to wait a bit longer then try again. However, if this persists for a very long time, probably rebooting your system is the safest workaround in this situation since it will terminate any instance of dpkg that is still running and the lock will be removed naturally.


You might, however, end up with broken installation of the two packages you interrupted. If that happens, you need to run the following commands in the order below:


sudo dpkg --configure -a

Then:


sudo apt install --fix-broken -f

[#624] Sunday, April 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rillrage

Total Points: 122
Total Questions: 120
Total Answers: 103

Location: Tokelau
Member since Thu, Aug 26, 2021
3 Years ago
rillrage questions
Wed, Apr 6, 22, 17:39, 2 Years ago
Sat, Apr 30, 22, 13:11, 2 Years ago
Wed, Mar 9, 22, 05:33, 2 Years ago
;