Ubuntu e: unable to get lock / var / lib / dpkg / lock front – Open (11: resource temporarily unavailable)

Time:2021-6-12

Ubuntu 18.04, the same with other versions of Ubuntu

Question:

When running sudo apt get install / update / or other commands, the following prompt sometimes appears due to various unclear reasons:

E: Unable to get lock / var / lib / dpkg / lock front – Open (11: resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

Ubuntu E: 无法获得锁 /var/lib/dpkg/lock-frontend - open

The reasons for this problem may be as follows:

Under the terminal of Ubuntu system, useapt-get install When installing the software, if the terminal is forced to shut down without completing the download. The apt get process may not end at this time. As a result, if you run it againapt-get install Command to install the software, the above error. Another program is in useapt-get installWhen a process is running, it will occupy the system lock when the software source is updated (referred to as “system update lock”).

So,The first method, we just need to kill the previous process and release the system lock

ps -e|grep apt-get

display

5873 ?        00:00:01 apt-get

Then execute

sudo kill 5873

The second method is forced unlocking

[email protected]:~$ sudo rm /var/cache/apt/archives/lock
[sudo] password of linuxidc: 
[email protected]:~$ sudo rm /var/lib/dpkg/lock

Ubuntu E: 无法获得锁 /var/lib/dpkg/lock-frontend - open

summary

The above is about Ubuntu e: unable to get lock / var / lib / dpkg / lock front – Open (11: resources temporarily unavailable). I hope it can help you. If you have any questions, please leave me a message and Xiaobian will reply you in time. Thank you very much for your support to developer!
If you think this article is helpful to you, please reprint, please indicate the source, thank you!