Reinstalling all Debian packages

Try this, remembering that I did not test it:

dpkg --get-selections > selections
sudo dpkg --clear-selections
sudo dpkg --set-selections < selections
sudo apt-get --reinstall dselect-upgrade

Sources:

  • http://www.linuxquestions.org/questions/linux-software-2/force-apt-get-to-redownload-and-reinstall-dependencies-as-well-873038/
  • https://kura.io/2010/07/02/using-dpkg-selections-to-backup-and-install-packages/?ModPagespeed=noscript
  • man apt-get

When using Aptitude there is an easy and fast way to do it:

sudo aptitude reinstall '~i'

which will reinstall all currently installed packages.


Just in case, try to reinstall each package:

for i in $(cat list.log); do apt-get install --reinstall "$i"; done

You may wish to add answer yes to all questions option too.