Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does `apt` handle packages as cleanly as `dnf` and `yum`? Last time I tried `apt`, it would uninstall apps without cleaning after itself.


It will not automatically remove dependencies that were installed along with a package when that package is removed. I'm guessing this is due to some historical ideology about how `apt-get` was intended to function. I just typically run `apt remove foobar && apt -y autoremove`.

There is also nala, which _does_ automatically remove dependencies when you remove a package: https://github.com/volitank/nala


aptitude also auto removes dependent packages and is in Debian stable.

It has also a useful 'aptitude why package' to say why a package is installed and a nice TUI (which is optional; for the most part it works very similar to apt).


Is it aware if another package is using the same dependency, so it only removes the dependency if it is not being used by anything else?


Yes, that's what 'apt autoremove' does... remove packages that were installed as a dependancy, but are no longer needed because packages using it have been removed.

However, the package could of course still be used by unpackaged software or local scripts.


“apt purge” takes no prisoners.


Apt purge cleans up user config files after a package, but not package dependencies. For complete package removal, apt autoremove is needed even after apt purge.


So apt uninstall -> apt purge -> apt autoremove

That looks like an unnecessarily long process to safely remove a package. Why isn't that the default behavior on Debian?


You can skip the uninstall if you use purge.

And aptitude (alternative package manager) automatically removes dependent but not required anymore packages when removing/purging a package.


There's also autopurge, which can take arguments of additional packages to purge, like autoremove. So you only really need _one_ command.


True, but its output suggests that you do that and tells you what it would autoremove.


Indeed. So it not only doesn't do a complete job, it "takes prisoners" too. Taking no prisoners would mean it's aggressive, relentless, thorough, and apt is neither of these, it's a solid, professional tool, with some legacy baggage, but at least it's friendly and discoverable about it.

In the current thread, I'm only nit-picky about this, because OP said "Last time I tried `apt`, it would uninstall apps without cleaning after itself". To which to suggest that apt-purge does clean up after itself is incorrect. It does some additional cleaning-up, but it doesn't do a complete cleaning-up.

That being said, of all the package managers I tried, I still like apt the best. I feel like it's the most straightforward and user-friendly of all of them.


Nowadays you can just pass --autoremove to `apt purge <package>` and it will.


Do you remember which package, or if it was an official Debian package vs third-party? The former is usually pretty well written.

Do you have a use-case where packages are regularly uninstalled? I usually only install.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: