vadviktor
5/16/2017 - 9:47 AM

Ubuntu: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

Ubuntu: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

A very simple approach would be a script that waited for the lock to not be open. Let's call it waitforapt and stick it in /usr/local/bin. Then just run sudo waitforapt && sudo apt-get install whatever.

#!/bin/sh

while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
   sleep 1
done