↑ ↓ select, Enter open, Esc close

Remove unused dependencies (apt autoremove)

Caution: This command changes the system. Understand what it does before you run it.

root@server
apt autoremove

Removes packages that were once installed as a dependency and are no longer needed by any installed package. Typical candidates are old kernels and libraries after a version change. Before removing anything, apt shows the list and waits for confirmation, and configuration files are kept.

Note: Check the list before confirming. If a package you need was only installed as a dependency, it will be removed too. Prevent that beforehand with apt-mark manual paketname.

Also searched as

  • remove old kernels debian
  • apt autoremove unused packages
  • packages were automatically installed and are no longer required

Related one-liners

All in Debian and APT

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.