Skip to main content

Remove orphaned packages (Linux)

When we install a package in most of Linux distributions, the package system installs other packages needed by the package that we actually want to install. If we uninstall the package, its dependencies won't be uninstalled, these unused dependencies are called orphaned packages.

Remove orphaned packages


pacman -Rsn $(pacman -Qdtq)

How does the command work?

  • pacman -Qdt list all orphaned packages
  • pacman -Rsn uninstall the listed packages


apt-get remove --purge $(deborphan)


Comments powered by Disqus