unable to get lock/var/lib/dpkg/lock
e:could not get Lock/var/lib/dpkg/lock-open (one Resource temporarily unavailable)
An output error similar to the following occurs when you perform the command of sudo apt-get XXX:
E:could not get Lock/var/lib/dpkg/lock-open (one Resource temporarily unavailable)
e:unable to lock the Administra tion directory (/var/lib/dpkg/) is another process using it?
Or:
E:could not GE Lock/var/lib/apt/lists/lock-open (11:resource temporarily
unavailable)
e:unable to lock Direc tory/var/lib/apt/lists/
e:could not get Lock/var/lib/dpkg/lock-open (11:resource temporarily unavailable)
E: Unable to lock-administration directory (/var/lib/dpkg/), is another process using it?
explain
This problem occurs because there is another thread that is using apt-get for downloading. But strangely enough, I just didn't find any other terminal interface using the apt-get directive. So how to solve this problem, do you want to restart the computer, restart the computer can solve the problem, but the next way I teach you is the real solution. Solutions
Search for all running threads first
ps-a | grep apt-get
You will get output similar to the following:
Root 752 0.0 0.0 4508 1628? Ss 01:13 0:00/bin/sh/usr/lib/apt/apt.systemd.daily
_apt 2098 0.1 0.1 49572 5524? S 01:18 0:06/usr/lib/apt/methods/http
aobo 4425 0.0 0.0 18484 980 PTS/1 s+ 02:13 0:00 grep--color=auto Apt
The 2nd column is the thread number (kill Processnumber). We have closed the process of apt , and need to use sudo permissions:
# sudo kill processnumber
sudo kill 2098
Output:
Bash:kill: (2098)-Operation not permitted
Now close the current terminal , and then reopen a terminal, sudo apt-get command can be used.
Reference website:
Http://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process
Http://askubuntu.com/questions/452638/how-can-i-solve-unable-to-lock-the-administration-directory-var-lib-dpkg