Skip to content

Instantly share code, notes, and snippets.

@alwalker
Created April 5, 2018 12:09
Show Gist options
  • Save alwalker/c52bf42b0ebf07b9417228db85146e6d to your computer and use it in GitHub Desktop.
Save alwalker/c52bf42b0ebf07b9417228db85146e6d to your computer and use it in GitHub Desktop.
IS_LOCKED=$(sudo lsof /var/lib/dpkg/lock | wc -l)
echo "Is Locked? $IS_LOCKED"
until [[ $IS_LOCKED -eq 0 ]]; do
echo "Is Locked? $IS_LOCKED"
echo "sleeping for 5"
sleep 5
IS_LOCKED=$(sudo lsof /var/lib/dpkg/lock | wc -l)
done
echo "we made it out!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment