Skip to content

Instantly share code, notes, and snippets.

@aliabidzaidi
Last active December 16, 2021 10:13
Show Gist options
  • Save aliabidzaidi/fd873021efc7f70d276a7128ce22848e to your computer and use it in GitHub Desktop.
Save aliabidzaidi/fd873021efc7f70d276a7128ce22848e to your computer and use it in GitHub Desktop.
Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) [FIX]
# E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
# E: Unable to lock directory /var/lib/apt/lists/
# E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
# E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
sudo killall apt apt-get
# If none of the above works, remove the lock files. Run in terminal:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
# then reconfigure the packages. Run in terminal:
sudo dpkg --configure -a
# and
sudo apt update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment