When using the installation command sudo apt-Get install XXX on the Ubuntu terminal, the following error may occur:
Input: APT-Get install Vim
The following figure is displayed:
E: unable to obtain the lock/var/lib/dpkg/lock-open (11: The resource is temporarily unavailable)
E: The management directory (/var/lib/dpkg/) cannot be locked. Is there any other process occupying it?
Refer to UbuntuCommunityA post and a Sina Blog finally solved the problem. The URL is a post in the Ubuntu community.And a Sina Blog
Solution 1: Check whether there are two Apt
Force unlock, and enter the command in the terminal
Sudo RM/var/Cache/APT/archives/lock
Sudo RM/var/lib/dpkg/lock
Solve the problem.
This problem is actually caused by Operation problems. You must have forcibly shut down the terminal (for example, CTRL + Z), so you cannot obtain the exclusive lock due to running, the solution is to develop a good habit. The terminal often uses Ctrl + C to terminate the operation, and the same problem will not occur in the future.
Solution 2: Disable the apt-Get process forcibly terminated by you.
Enter PS-Aux on the terminal to list processes. Find the process P containing apt '-Get or wgetID,
Sudo kill PID directly. Solution.