Debian – Find Packages Installed Due to Recommendations or Suggestions

aptdebiandependenciespackage-management

On Debian I can use apt-get autoremove to remove packages that are no longer needed, i.e., that are not a dependency of any "manually installed" package. However, this does not remove packages that are merely "suggested" or "recommended" by manually installed packages. How can I find out the list of such packages on my system?

Best Answer

You can also tell apt-get autoremove to ignore “Recommends” and “Suggests”:

sudo apt-get autoremove -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false

Use -s to get a list of the removals this would lead to without actually changing anything:

sudo apt-get autoremove -s -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false