« Back to Package manager: Frequently Asked Questions

How to remove unused packages with apt?

How to remove unused packages with apt?

Run apt with the autoremove subcommand to remove any package that the package manager considers to be unnecessary.

apt autoremove

After packages are upgraded on systems running apt, the package manager have mark some packages as no longer required. Typically this happens when a dependency on another package has been removed, or another package supersedes the existing package. In that case the package becomes an orphan and no longer provides specific function another package or to the system.

Run the apt command with the autoremove subcommand to check for orphaned packages and remove them.

apt autoremove

Learn more about apt

This article uses the apt command to achieve its tasks. For this popular tool there is a cheat sheet available!

» Mastering the tool: apt

apt cheat sheet

Other questions related to Package manager

    Related articles

    Like to learn more? Here is a list of articles within the same category or having similar tags.

    Feedback

    Small picture of Michael Boelen

    This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

    Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

    Mastodon icon