Hacker News new | ask | show | jobs
by eingaeKaiy8ujie 1795 days ago
Debian stable is a great choice for a system where you need stability and security. For regular desktop usage though, Debian Sid (unstable) may be better because you get newer software.

There is only one issue I had with Debian: I don't like/understand how it's package manager handles unneeded software.

For example:

1. I installed Debian with the Gnome interface.

2. Decided to try KDE, installed it alongside Gnome.

3. Deleted KDE. But then there still were lots of KDE-related packages left. I tried `apt autoremove` and some other stuff, but no matter what I couldn't figure out how to easily remove all unneeded packages and return to the previous state.

4 comments

The /var/log/apt/history.log file should have a full list of the installed packages, which you can copy-paste to remove.

This is likely because by default Recommends and Suggests both prevent autoremovals and there are probably some circular depends/recommends/suggests loops preventing removing things. The APT::AutoRemove::RecommendsImportant and APT::AutoRemove::SuggestsImportant options can be used to disable this behaviour, so you could try the Suggests one first. Adding the Recommends one would autoremove lots of other stuff too though.

Another thing you could do next time is list all packages (apt list) before and after, then diff the lists to see what was added/removed/upgraded and manually revert that.

If you have found a package and you don't know why apt-get autoremove doesn't remove it, try: apt-cache rdepends --installed pkgname
Thanks, I'll try that.
I think ‘aptitude why’[1] will also tell you why a package is installed and is easier to remember.

[1] https://www.debian.org/doc/manuals/debian-reference/ch02.en....

This makes me wonder how you installed KDE. If it was by installing a single top-level package (e.g. kde-standard or maybe kde-plasma-desktop), then I would expect apt autoremove on that package to just work. (Unless you later manually installed more packages that shared some dependencies with the top-level package, in which case you would have to remove those as well.) APT distinguishes between manually-installed and automatically-installed packages for exactly this reason.

It also distinguishes config from other files. By default, it will keep modified config files when you remove packages. That way you don't accidentally delete the custom web site definitions that took you hours to create. You can use --purge to override this conservative behavior.

Debian's packaging system isn't the simplest, but I find it to be reliable, good at dealing with edge cases and failures, and extraordinarily well documented. It's part of why I switched to debian-based distros well over a decade ago.

This has been a problem for a long time. I'm not sure why other distributions are better at this than Debian, but I think it has something to do with how Debian splits up software in much more packages than other distributions. Maybe it's more difficult to keep track of the state?