Unable to acquire the dpkg frontend lock error is the most common error that happens with Linux systems, this can be solved easily. This error is being displayed because another programme is attempting to update Ubuntu. A command or application locks the dpkg file when upgrading the system or installing new software (Debian package manager).
The error “unable to acquire the dpkg frontend lock” happened due to various reasons and can be solved by understanding the cause of the problem.
We can run the following command to check the error log and take a look at the process ID and error message.
$ sudo lsof /var/lib/dpkg/lock-frontend
frontend-lock-log
So here are a few common causes and their fixes:-
1. Unprivileged access
sudo-error
$ apt install nano E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
In this case, the user doesn’t have access to run the particular command without having root access so users must use sudo to run the command before running it.
2. Broken package
dpkg: error: his package provides frequent translation updates.': version string has embedded spaces E: Sub-process /usr/bin/dpkg returned an error code (2)
sometimes when we try to install the app, the app can be broken due to connection loss and various other reasons, in this case, we can run the following command to fix this:-
$ sudo dpkg --configure -a or $ sudo apt install -f
3. Installing an app from unlisted repositories or missing repositories
add=ppa
$ sudo apt install grub-customizer E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
installed
Due to a typo or unavailability of apps in the repository it happens, in this case, you have to check the app ppa repository and add to the package repository, see in this thread for more details.
4. Frontend is locked by another process
Check if any process is running and using apt/dpkg
$ ps aux | grep -i apt
this is a dpkg error and finding the process id using the log command and by killing that PID will fix the issue
$ sudo kill -9 <PID> or $ sudo killall program_name
kill-example
5. Delete the lock file to fix the issue
This is a brute force method and you should use it carefully, although this also fixes the issue but system can be broken if you use this without understanding the error. Often restarting system can also fix the error so you must try restart before trying this step.
$ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock
delete-lock-file
I hope this article is helpful, give a like, happy learning.
Last Updated :
23 Nov, 2022
Like Article
Save Article
frontend-lock-log
So here are a few common causes and their fixes:-
1. Unprivileged access
sudo-error
$ apt install nano E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
In this case, the user doesn’t have access to run the particular command without having root access so users must use sudo to run the command before running it.
2. Broken package
dpkg: error: his package provides frequent translation updates.': version string has embedded spaces E: Sub-process /usr/bin/dpkg returned an error code (2)
sometimes when we try to install the app, the app can be broken due to connection loss and various other reasons, in this case, we can run the following command to fix this:-
$ sudo dpkg --configure -a or $ sudo apt install -f
3. Installing an app from unlisted repositories or missing repositories
add=ppa
$ sudo apt install grub-customizer E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
installed
Due to a typo or unavailability of apps in the repository it happens, in this case, you have to check the app ppa repository and add to the package repository, see in this thread for more details.
4. Frontend is locked by another process
Check if any process is running and using apt/dpkg
$ ps aux | grep -i apt
this is a dpkg error and finding the process id using the log command and by killing that PID will fix the issue
$ sudo kill -9 <PID> or $ sudo killall program_name
kill-example
5. Delete the lock file to fix the issue
This is a brute force method and you should use it carefully, although this also fixes the issue but system can be broken if you use this without understanding the error. Often restarting system can also fix the error so you must try restart before trying this step.
$ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock
delete-lock-file
I hope this article is helpful, give a like, happy learning.