This error message occurred today when installing SSH with the Apt-get directory under Ubuntu 14.04. Find out what might be the cause.
First, APT acts as a software update mechanism that locks the apt database every time it runs. When the above error message occurs, you should first find out which process is running the apt-get or APT command, such as system updates.
There are many ways to solve this problem.
First of all, you did not find out exactly which process is using the APT command, then you should restart the machine should be no problem. You can find filters by keyword in the current process of the system
PS grep Apt
Kill Processnumber
Finally, it's not going to erase the lock.
sudo RM /var/lib/apt/lists/lock
sudo RM /var/cache/apt/archives/lock
So the first thing I think about is the system update.
Here are the reference links:
Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?
Linux->> UBuntu->> Could not get Lock/var/lib/dpkg/lock-open (11:resource temporarily unavailable)