Skip to content

Instantly share code, notes, and snippets.

@kumichou
Created July 21, 2014 19:36
Show Gist options
  • Select an option

  • Save kumichou/fbbac1fcba896a797116 to your computer and use it in GitHub Desktop.

Select an option

Save kumichou/fbbac1fcba896a797116 to your computer and use it in GitHub Desktop.
Sometimes the APT cache gets corrupted and both apt-get and aptitude won't install or update packages. If you want to rebuild that list, this is the script for you!
#!/usr/bin/env bash
mv /var/lib/dpkg/available /root/available-corrupted
touch /var/lib/dpkg/available
sh -c 'for i in /var/lib/apt/lists/*_Packages; do dpkg --merge-avail "$i"; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment