Skip to content

Instantly share code, notes, and snippets.

@charlieporth1
Created November 29, 2021 16:54
Show Gist options
  • Save charlieporth1/92e36e17604c2590bf24ae198b74d6b1 to your computer and use it in GitHub Desktop.
Save charlieporth1/92e36e17604c2590bf24ae198b74d6b1 to your computer and use it in GitHub Desktop.
Simple apt lock & fix for Ubuntu
#!/bin/bash
if [[ -f /var/lib/dpkg/lock ]]; then
rm /var/lib/apt/lists/lock
rm /var/cache/apt/archives/lock
rm /var/lib/dpkg/lock*
fi
yes | sudo dpkg --configure -a
yes | apt -y --fix-broken install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment