71

I'm not sure what sudo apt-get autoremove does, but have read that you should use this command to remove any unnecessary packages.

One of the processes I saw was to use sudo apt-get autoremove and then use something like BleachBit to remove temp files etc.

Can you explain what sudo apt-get autoremove actually does and is there any advantages of using this command over something like BleachBit or Ubuntu Tweak janitor by themselves?

| improve this question | | | | |
96

what sudo apt-get autoremove actually does

Whenever you install an application (using apt-get) the system will also install the software that this application depends on. It is common in Ubuntu/Linux that applications share the same libraries. When you remove the appplication the dependency will stay on your system.

So apt-get autoremove will remove those dependencies that were installed with applications and that are no longer used by anything else on the system.

is there any advantages of using this command over something like Bleachbit or Ubuntu Tweak janitor?

  • Bleachbit or Ubuntu Tweak janitor are graphical interfaces.
  • sudo apt-get autoremove is a command

The one option does not exclude the other: I would assume BB and UTJ to use sudo apt-get autoremove (in some sort of way) to remove dependencies. So it is not a question of "any advantages". It is a matter of preference: are you a commandline type of person or are you a GUI type of person?

By the way: deborphan is another of these tools to clean your system.

| improve this answer | | | | |
  • Thank you for sharing this. In my own experience running sudo apt-get autoremove is safer than using something like Bleachbit, i (and a friend of mine) have run into problems after using Bleachbit. Just running sudo apt-get autoremove seems safer to me. Though i guess it also depends on how you configure your cleaning inside Bleachbit (there are a lot of options presented with checkboxes for what you want to clean up) – sunyata Jul 13 '17 at 16:52
5

One minor addition: Since 14.04 you may actually write apt autoremove to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies.

These two commands are equivalent:

  • apt autoremove
  • apt-get autoremove
| improve this answer | | | | |
  • 5
    I'm super late to this party here @matt, but I believe you're meant to use apt interactively, and specifically not meant to use apt in scripts. The apt-get command (and other apt-* commands) are designed to have stable behavior in the long term, whereas apt is intended to be simpler and more user-friendly, and will continue to evolve or change in ways that humans like. Specifically, they've said that '[apt's] output may be changed between versions' so that's one reason you should avoid it in scripts if you care about the output. – XP84 Feb 20 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.