Bug#981168: apt: autoremove does not remove dependencies
On Thu, Jan 28, 2021 at 11:31:39AM +0100, Julian Andres Klode wrote:
> On Wed, Jan 27, 2021 at 03:12:17AM -0500, Scott Colby wrote:
> > Package: apt
> > Version: 1.8.2.2
> > Severity: important
> >
> > Dear Maintainer,
> >
> > I am having some difficulty with apt's autoremove command. In order to get a
> > clean reproduction, I installed Debian in a fresh virtual machine from the
> > debian-10.7.0-amd64-netinst.iso that I downloaded this evening.
> >
> > I ran the following sequence of commands:
> >
> > # apt update; apt upgrade
> > # apt install exim4 # 24 packages are installed
> > # apt remove exim4 # only exim4 is removed, as expected
> > # apt autoremove # no other packages are removed!
> >
> > I would have expected the 23 other packages installed by the install command
> > would be removed by the subsequent autoremove. Why is this not happening? Is
> > this a misconfiguration, a bug, or a misunderstanding on my part?
>
> Most likely:
>
> exim4 depends on an exim4-daemon-$something, all of which provide
> mail-transport-agent. If one installed package depends/recommends/suggests
> mail-transport-agent, it won't be autoremoved.
>
> This is not a bug, and we might eventually get a cool feature to undo
> history, but it's not there yet, and I don't want to track it in a bug.
As a bonus point; I do have a system cleanup script that removes as many
automatically installed packages as possible while keeping all manually
insttalled ones:
http://salsa.debian.org/jak/cleanup
Clone that, install clasp, and run ./program_builder.py to have it give
you a list of packages that can be removed.
This is very thorough and a lot less safe than apt's autoremove.
I need to work on adding a clasp solving backend to apt, then we can
have a thorough autoremove code in apt too (and solve dependencies and
order installations as best as possible :D).
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Reply to: