By mistake I forgot to add --no-install-recommends flag to my apt-get install command, is there a way to purge those recommended packages after they've been installed?
Asked
Active
Viewed 4,298 times
4
Oxwivi
- 17,849
2 Answers
7
In addition to enzotibs answer, if you wish to avoid adding --no-install-recommends each time, you can also disable automatic installation of recommended package by setting the APT::Install-Recommends setting to 0:
umask 0022;echo 'APT::Install-Recommends "0";' | \
sudo tee /etc/apt/apt.conf.d/00DisableInstallRecommends
The umask 0022 causes the file to be created with permissions 644, restrictive permissions breaks operations like apt-get -s ... (simulate).
Lekensteyn
- 174,277
3
I think the sequence
sudo apt-get purge $packages
sudo apt-get autoremove
sudo apt-get --no-install-recommends install $packages
is the way to go.
enzotib
- 93,831
reinstallis wrong, maybe you mean--reinstall install, but even when corrected, it don't seem to work, from my tests. – enzotib May 03 '11 at 08:13