The use and recommendation (in the docs) of dnf autoremove

In ask.:fedora:, it was just raised a topic about dangers of dnf autoremove and about how and when it should be recommended in the docs and elsewhere:
https://discussion.fedoraproject.org/t/use-of-dnf-autoremove/68772

It also contains potential indication of unintended behavior (dnf autoremove to remove the kernel, grub and such), which I could not yet reproduce. Other experiences with that? What do you think about the issue, especially related to the docs?

3 Likes

Hmmm, I see. Thanks for linking that here.

I’m tempted to agree with this comment:

You’re not gonna gain anything with that command, maybe except 100 megs of space

That’s true in my experience, although obviously it might be different for others, but I think for most people all they’re going to gain with autoremove is a little bit of space. If that’s the only potential benefit, and a potential detriment includes nuking the whole system, then I think we should remove the entire section from the upgrade docs to be on the safe side.

3 Likes

I guess a warning that says something like: “inspect the packages being removed before hitting ‘y’ because sometimes it may find system critical packages to remove also. when unsure, ask someone on the community channels, such as ask.fp.o” could be added.

I’ve not had an experience where it tried to remove critical packages too, and I don’t think it should. So that could be a bug perhaps. (also responded on Ask)

2 Likes

This is also my experience. I never had an issue with it and was a bit shocked when @augenauf told me about his experience. However, maybe it makes sense to add a warning that users who have customized protected packages, customized package db, or work with packages that where originally installed as a dependency of something else (e.g., work directly with backends) should be even more careful.

The latter is my sole explanation of JV’s issue mentioned in the ask.:fedora: thread. Removal of kernel on the other hand, is a bug that should be filed, if it is not based on a customization. But given the fact that this function is in much use & recommendation (docs, much on the Internet, not just ask.:fedora:), I would assume if there is a general problem with it, we would have much more threads about it.

@pbokoc I agree and disagree with that :slight_smile: On one hand, you are right, this is nothing you need after every upgrade. On the other hand, if a system is in use for a long time throughout many upgrade cycles, this function is worth a lot in my experience. But maybe it makes sense to remove it from the general upgrade page and add another page about how to free disc space? In that page the dangers and considerations could be a bit more elaborated (e.g., include the above points), also the risks for highly customized systems. The upgrade page could link to it for users who use their systems throughout many cycles.

2 Likes