Last active
June 20, 2022 23:07
-
-
Save mmastoras/b49d466579c97d36c83e9e008fa75f66 to your computer and use it in GitHub Desktop.
dpkg lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update | |
apt-get install -y psmisc | |
i="0" | |
while [ $i -lt 10 ] | |
do | |
if [ $(fuser /var/lib/dpkg/lock) ]; then | |
i="0" | |
fi | |
sleep 1 | |
i=$[$i+1] | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this will continue looping until dpkg lock is clear for 10 seconds.