Skip to content

Instantly share code, notes, and snippets.

@kovshenin
Last active August 26, 2021 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kovshenin/afd753d3f1535b9425c8c9bc8f4779a4 to your computer and use it in GitHub Desktop.
Save kovshenin/afd753d3f1535b9425c8c9bc8f4779a4 to your computer and use it in GitHub Desktop.
Safe apt-get
#!/bin/bash
while fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1 ; do
sleep 0.5
done
/usr/bin/apt-get "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment