When we tried to install one package using “apt-get install” , we got following error,
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 6345 (unattended-upgr)
and we were not able to install the package. As seen in error, we can see that some lock is held by some process which is blocking the new packages installation.
So, we tried to identify which process is holding the lock as,
$ ps -ax | grep lock
/bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
Solution :
We waited for few minutes for this process to complete and release the lock. Then we were able to install the packages without any problem. So, it seems this is temporary blocking and we need to wait.