Is apt-get purge --auto-remove packagename a valid command?

Or, does it have to be apt-get remove --purge --auto-remove packagename?

The Ubuntu manpage for apt-get (http://manpages.ubuntu.com/manpages/precise/man8/apt-get.8.html) only mentions using the --auto-remove option "If the command is either install or remove...", so I was wondering if it could also be used with the purge command, since that is just a shortcut for the remove command with the --purge option.

Thank you.

  • 1
    why --auto-remove?
    – Alvar
    Oct 17, 2013 at 21:45
  • 3
    If the --auto-remove option is used when removing a package then it will remove dependencies of the package that are no longer needed. Kind of like how apt-get autoremove checks for and will "remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed" (from above-linked manpage).
    – user981178
    Oct 17, 2013 at 21:52
  • 1
    If you examine the manpage, you will notice that autoremove can be used as a command (autoremove) or as an option (--auto-remove) during a command. However, it is only mentioned as an option in the context of an install or remove command, so I wondered if the option could also be used with a purge command. Using the option is just kind of a way to shortcut it, instead of running two separate commands.
    – user981178
    Oct 17, 2013 at 22:10
  • 14
    You can also use apt-get autoremove --purge
    – daboross
    Oct 17, 2013 at 23:10

1 Answer 1


Yes, those commands are valid. Moreover, they are equivalent because purge is equivalent with remove --purge (see man apt-get).

  • Thanks. Yes, I did figure that if the first was valid, then it would be equivalent to the second. I just wanted to make sure that the first was indeed valid.
    – user981178
    Oct 17, 2013 at 22:11

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.