Solve the problem: E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)

Description of the problem: sudo apt-get install mysql-client-core-5.7, when using this command to install the MySQL client program today, an error occurs

 When executed in solution, the code

 sudo dpkg --configure -a

Another error occurred, the process is occupied

 Solution:

1. Find the lock file process

lsof /var/lib/dpkg/lock-frontend

 Find out its PID, write it down

2. Terminate the process

sudo kill -9 PID

After inputting, enter lsof /var/lib/dpkg/lock-frontend, there is no locked process 

3. Remove the lock and reconfigure dpkg

sudo rm /var/lib/dpkg/lock-frontend
sudo dpkg --configure -a

 After execution, enter sudo apt-get install mysql-client-core-5.7

problem solved 

Guess you like

Origin blog.csdn.net/qq_61897141/article/details/128348770