sudo apt-get autoremove --purge -y

Category: VPS Management

sudo apt-get autoremove --purge -y

Remove orphaned packages and their configs

autoremove deletes packages that became unneeded after upgrades or removals (dangling dependencies), and --purge also deletes their config files — a periodic hygiene step that frees disk and reduces attack surface. The -y flag skips the confirmation. It never touches explicitly installed packages, so it is safe after deploys.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.