E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

When using sudo apt-get install… in Ubuntu system

Encountered an error:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Analysis:

In fact, it is the problem of resources being occupied by other processes. Killing other processes to release resources should be no problem.

Solution one (simple and rude):

sudo pkill apt

Solution two (if method one does not work):

Update apt

sudo apt-get install update

Solution three (if the second method is not possible)

Force unlock

sduo rm /var/lib/dpkg/lock

Guess you like

Origin blog.csdn.net/weixin_39536859/article/details/106657673