Recently, after upgrading my laptop to Debian Squeeze, a prompt appeared at each security upgrades asking for a purge of some packages which were no longer needed by the system.
As requested to gain more space, I issued the command “apt-get autoremove” and a large bunch of packages was removed. But the operation brought me some trouble while running Debian the day after. Looking at the state of the packages through dpkg, I noticed that many packages status were set to deinstall.
How to install them again without having a precise list of packages to deal with?
Here is the operation I realized successfully.
First, save the current state of the packages :
root@localhost:~#dpkg –get-selections > /tmp/list_current_packages.log
Then, reinitialize the status of all the packages. By default, it will be set to “deinstall”.
Modify the file /tmp/list_current_packages.log by replacing “deinstall” by “install”. Finally, to reinstall the packages you want :
root@localhost:~# dpkg –set-selections < /tmp/list_current_packages.log