How does apt-get autoremove work when given a package as an argument?
You are (almost) correct in your assumption. Running apt-get autoremove <package>
will first remove <package>
, and then autoremove as if you had run apt-get autoremove
with no parameters (i.e. removing all "automatically installed" packages that are not a dependency of any "manually installed" packages).
The important distinction here is that the autoremove part of running apt-get autoremove <package>
will remove not only packages that are a dependency of <package>
, but all packages that would otherwise be autoremoved.