Spring Clean Your Linux System: A 7-Step Maintenance Checklist
A step-by-step seasonal tune-up for Linux: measure disk usage, clear package caches, prune unused software, tame logs, and refresh backups you can actually restore.

The first warm weekend of the year is a good excuse to look at your Linux machine the way you'd look at a garage in April. Some of what's in there is still useful, some you forgot you owned, and a fair amount is just dust. None of it requires a rescue USB stick or a late night with a live CD. You need an hour, a terminal, and a healthy suspicion of the delete key.
Work through these steps in order. Each one stands on its own, so you can stop after any of them and still have a working system.
1. Measure before you delete anything
Deleting feels productive. Deleting the wrong thing feels like a lost afternoon. Start by finding out where the space actually went.
Run df -h to see which filesystem is full, then du -sh * inside the obvious suspects: /var, /var/log, /var/cache, your home directory. If you prefer something you can point at, install ncdu or baobab and browse the tree visually. That single step usually explains the problem in ten seconds.
Pay attention to the usual offenders: an old virtual machine image in Documents, a Docker setup with layers nobody uses (docker system df reports this tidily), a Steam library on the root partition, or /home belonging to a user account you deleted from /etc/passwd but never removed from disk. Find the file before you reach for the broom.
2. Empty the package manager's cache
Every upgrade leaves the downloaded package behind, which is helpful for offline reinstallations and useless for everyone else. These directories can quietly reach several gigabytes.
- Debian/Ubuntu: sudo apt clean removes everything in /var/cache/apt/archives; sudo apt autoclean removes only obsolete versions.
- Fedora/RHEL: sudo dnf clean all clears metadata and cached packages.
- Arch: sudo pacman -Sc removes packages no longer installed; -Scc removes everything, including the current versions.
- openSUSE: sudo zypper clean --all.
If you're on a metered connection or regularly repair systems offline, keep the current versions and clear only the obsolete ones. For everyone else, clearing the lot costs one download later and buys real space now.
3. Remove software you no longer use
Uninstalling an application is only half the job. Dependencies it pulled in stay behind, along with leftover configuration and old kernel builds that eat space in /boot.
- On Debian and Ubuntu: sudo apt autoremove --purge. Then skim sudo apt list --installed for names you don't recognise. On Fedora, sudo dnf autoremove covers the same ground; on Arch, pacman -Qtdq lists orphans and pacman -Rns removes them.
- Check sandboxed packages too: flatpak uninstall --unused, and snap list --all to find disabled revisions you can drop.
- Old kernels are usually handled by autoremove. If /boot keeps filling on Fedora, check installonly_limit in /etc/dnf/dnf.conf. Never delete kernel files in /boot by hand unless you know which one your bootloader points at.
- Editor extensions, browser profiles from deleted apps, and language runtimes installed through nvm or pyenv belong in this pass as well.
4. Take the journal out of the equation
systemd's journal is a wonder until it isn't. journalctl --disk-usage tells you how much room it occupies; sudo journalctl --vacuum-time=2weeks trims it to a sane size, and --vacuum-size=500M does the same with a hard ceiling. To make that permanent, set SystemMaxUse in /etc/systemd/journald.conf and restart systemd-journald.
Then walk through /var/log. Don't delete files by hand. Instead, find the one log that's growing out of proportion, because a runaway log almost always means a service is failing in a loop. Read the last page of it. Fixing a broken cron job or a database that can't reach a socket will save more space than any cleanup command.
5. Sweep your home directory
This is where the real clutter lives, and it's also where a careless command hurts the most. Safe targets are caches that rebuild themselves: ~/.cache, thumbnail stores, browser cache directories, and the trash at ~/.local/share/Trash. Old ISO images, downloaded installers, screen recordings, and abandoned project folders with a 400 MB node_modules are fair game too.
Leave ~/.config and ~/.local/share alone unless you know what put something there. That's where application settings, mail, keyrings, and game saves live, and no amount of reclaimed disk space is worth losing them. When in doubt, move a directory to an external drive for a month instead of deleting it.
6. Refresh your backups and prove they work
A spring clean is a fine moment to notice that your backup job has been failing since November. Before the deletions, if possible, sync whatever matters: docs are much easier to write than to recover. Tools like rsync, restic, borg, or Timeshift all do the job; the tool matters less than the routine.
An untested backup is a wish, not a plan. Restore one file to /tmp and open it.
Two practical checks while you're there. First, confirm the destination is actually mounted, because an automated rsync writing to an unmounted mountpoint will happily fill your root partition. Second, look at your own notes: what's excluded from the backup, and would you miss it? Screenshots and dotfiles are easy to overlook until you need them.
7. Update, reboot, and check what starts automatically
Finish with a full upgrade (apt full-upgrade, dnf upgrade --refresh, or pacman -Syu) and restart. Then spend five minutes on things that run without asking: systemd-analyze blame and systemctl list-units --failed show what's slow or broken, while ~/.config/autostart, crontab -l, and systemctl list-timers reveal jobs you scheduled and forgot. On supported hardware, fwupdmgr get-updates is worth a look for firmware fixes.
Turn it into a fifteen-minute routine
One long session a year beats nothing, but a short pass each month beats both. The cache-clearing and autoremove commands never change, so keep them in a plain text file along with the dates you ran them and what you removed. Skip the third-party "cleaner" scripts you find in forums: they rarely understand your system better than you do, and the ones that run recursive deletes across /var or your home directory cause more rebuilds than they prevent.
Do the measurements first, back up before the big deletions, and stop when the disk graph looks reasonable. Your machine doesn't need to be pristine. It just needs to boot quickly, update cleanly, and hold everything you'd miss if it vanished.
Photo: Atlantic Ambience / Pexels



