[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please, don't let sudo be auto-removable



On Wed, Jul 30, 2025 at 4:24 PM Andy Smith wrote:
>
> > Start-Date: 2025-07-30  08:30:22
> > Commandline: apt-get autoremove
> > Requested-By: chafar (1000)
> > Remove: python3-blinker:amd64 (1.5-1), python-babel-localedata:amd64
> > (2.10.3-1), python3-webcolors:amd64 (1.11.1-1), libxaw7:amd64 (2:1.0.14-1),
> > python3-importlib-metadata:amd64 (4.12.0-1), libeatmydata1:amd64 (130-2+b1),
> > python3-jsonpatch:amd64 (1.32-2), python3-more-itertools:amd64 (8.10.0-2),
> > python3-attr:amd64 (22.2.0-1), gdisk:amd64 (1.0.9-2.1), python3-babel:amd64
> > (2.10.3-1), python3-jsonschema:amd64 (4.10.3-1), python3-oauthlib:amd64
> > (3.2.2-1), python3-json-pointer:amd64 (2.3-2), python3-jinja2:amd64
> > (3.1.2-1+deb12u2), python3-serial:amd64 (3.5-1.1), python3-netifaces:amd64
> > (0.11.0-2+b1), python3-uritemplate:amd64 (4.1.1-2), python3-markupsafe:amd64
> > (2.1.2-1+b1), python3-jwt:amd64 (2.6.0-1), eatmydata:amd64 (130-2),
> > python3-yaml:amd64 (6.0-3+b2), sudo:amd64 (1.9.13p3-1+deb12u1),
> > python3-rfc3987:amd64 (1.3.8-2), python3-pyrsistent:amd64 (0.18.1-1+b3),
> > python3-zipp:amd64 (1.0.0-6)
> > End-Date: 2025-07-30  08:30:24
> >
> > ... sudo gets inadvertently removed within a lot of python3 packages !!!
>
> It is only "inadvertent" because you did not like the outcome of your
> own actions. The meaning of autoremove in Debian is "offer to remove
> every non-essential package that no longer has any dependencies."

It would be helpful if autoremove SORTED the list of packages to be
removed so that other, important packages, wouldn't be hidden among
all the python3-whatever packages.

> i.e, you only got sudo in the first place because something in there
> depended on it or listed it as a recommend.

Maybe not.  I installed Debian 11 from a usb drive and was a bit
surprised that sudo didn't get installed, but no biggie.  I installed
it and moved on
Years later I did 'apt update; apt upgrade' to get Debian 12 and
today, after reading this thread, noticed that sudo was _not_ marked
as manually installed -- even tho I *did* manually install it back
when I was running Debian 11

> The fact that you in real life depended on it was not encoded in apckage
> dependencies. As the administrator it is your duty to to know that.

Wow.  How is one supposed to pick up that knowledge?

> You
> can express that you depend upon sudo being installed by manually
> installing sudo by name, or using apt-mark to mark it as such. Then it
> won;t be eligible for auto removal.

kewl

$ sudo apt-mark manual sudo
[sudo] password for lee:
sudo set to manually installed.

One less thing that might bite me in the ass.  Thanks

Regards
Lee


Reply to: