September 25, 2014
It’s been a couple of years I’m running Debian on my workstations, both at work and school, as well as on some servers.
I always start with the latest
netinst image, unticking everything
from the “What to install?” list, so I just have the bare minimum
packages, and I have a full control over what I install next. But the
fact is this is not enough.
Apt packages, along with dependencies, have two other “related packages” lists. Recommendations and suggestions. Unlike hard dependencies, these packages are optional – the software can work without them – but you can have additional functionality with them, that you may or may not need (protip: most of the time, you don’t).
By default, Apt installs everything, including recommendations
and suggestions. This is how, by default,
imagemagick will come as
nmap suggestion/recommendation (with several layers of
indirection). Do you really expect an image manipulation tool (and all
its related image and fonts libraries) to come with a network scanner?
I do not.
Not Debian. Not yet. But let’s begin with all these useless packages.
We’re gonna configure Apt to automatically consider those
non-explicitly installed suggestions/recommendations as orphans, so we
can easily purge them. We will also configure it so these packages
will no longer be installed in the first place. All you need is
# /etc/apt/apt.conf Apt::Install-Recommends false; Apt::Install-Suggests false; Apt::AutoRemove::RecommendsImportant false; Apt::AutoRemove::SuggestsImportant false;
The first two lines tell Apt not to install recommendations and suggestions anymore. The next lines tell Apt that existing recommendations/suggestions are not important, thus they can be purged.
Then, running an
aptitude install will prompt you to remove all the
packages that are not needed anymore (and there will probably be a whole
bunch of them). However, there’s maybe some of them you’ll want to
keep. Verify carefully the content of this list before confirming the
removal. Be sure to
aptitude unmarkauto the packages you want to keep
before running the final
Don’t forget to purge the configuration files by running
aptitude purge '~c'!