Imagine a package foo
that has a recommended dependency bar
and a suggested dependency baz
. How do I configure APT for the following behavior?
apt install foo
: installsfoo
andbar
; does not installbaz
apt autoremove
: no changesapt remove foo
: uninstallsfoo
apt autoremove
: uninstallsbar
I have tried setting these options in /etc/apt/apt.conf.d/99-norecommends
:
APT::AutoRemove::RecommendsImportant "false";
APT::AutoRemove::SuggestsImportant "false";
But, in the scenario above, this results in bar
being uninstalled in step 2.
What is the right combination of APT configuration options to meet my goal?
Update: I've installed a fresh instance of Debian in a VM, made no config changes, and ran the following commands:
apt update; apt upgrade
: nothing was out-of-dateapt install exim4
: lots of stuff was installed (apologies for any typos, I transcribed these manually out of the VM)exim4-base
mariadb-common
libwrap0
libython2.7
exim4-daemon-light
libltd17
libunbound8
mailutils-common
libgsas17
psmisc
exim4-config
libntlm0
guile-2.2-libs
mailutils
mysql-common
libmailutils5
exim4
libevent-2.1-6
libmariadb3
libgc1c2
libgnutls-dane0
libkyotocabinet16v5
libfribidi0
liblz02-2
apt purge exim4
:exim4
was uninstalledapt autoremove
: nothing was uninstalled
How do I get the other 23 packages to be removed automatically? I don't want to be looking back in my apt logs to try to reconstruct what needs to be done to fully reverse an apt install {...}
command, especially if there were intervening installations that could require some of the automatically-installed packages.
By the way, this clearly conflicts with the man page for apt-get
:
remove
remove is identical to install except that packages are removed instead of installed.
purge
purge is identical to remove except that packages are removed and purged
My testing above shows that install
and remove
/purge
are not symmetric as stated there.