Free Space with apt autoremove and apt clean
autoremove deletes no-longer-needed dependency packages, and clean wipes the downloaded .deb cache in /var/cache/apt/archives.
01Command
$ sudo apt autoremove --purge && sudo apt clean02What it does
Read the package list autoremove prints before typing Y — if it lists something you installed on purpose, mark it manual with `sudo apt mark manual <pkg>`. `apt clean` frees the most space after big upgrades, sometimes gigabytes of cached .deb files; `apt autoclean` only removes obsolete versions if you want a gentler option. On Fedora the equivalents are `sudo dnf autoremove` and `sudo dnf clean all`.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- apt(8) - Linux manual pageEvidence: apt autoremove removes packages that were automatically installed to satisfy dependencies and are no longer needed; apt clean clears the local repository of retrieved package files.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
ncdu scans a directory tree, then lets you browse sizes, navigate, and delete space hogs with one keypress.
dpkg -S tells you which installed package a file came from; dpkg -L lists everything a package put on disk.
Check how much space the binary journal consumes and permanently trim it by size, age, or file count.