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?


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.

  • 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

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
  • i thing apt and apt-get are the same as of some version of Ubuntu, in general, not specific to autoremove. isn't that the case? – matt Aug 23 '18 at 17:40
  • 1
    Yes, this is true @matt. – prosti Aug 23 '18 at 18:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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