Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Free Disk Space on Linux Without Deleting the Wrong Files

Find what is filling your Linux drive, clean package caches, review unused packages, and manage journal logs and Timeshift snapshots safely.

Table of Contents

When Linux reports low disk space, first find which filesystem is full and which directories are growing. Old downloads, virtual machines, package caches, logs and snapshots need different cleanup methods. Removing a few small apps may achieve little if one large disk image is the real cause.

Back up important personal files before deleting them. Use package managers and snapshot tools for system data rather than manually removing files from system directories. Linux cleanup behavior varies by distribution and configuration; it is not true that Linux never cleans up automatically.

1. Locate the space problem

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 1

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 2

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 3

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 4

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 5

Check filesystem usage in a terminal:

df -h

Look at the filesystem mounted on /, and also /home or /boot if they are separate. Free space on another drive does not solve a full root partition.

Disk Usage Analyzer, also called Baobab, provides a graphical breakdown of folder sizes. If it is not installed, use the command for your distribution, not both commands joined together:

Debian, Ubuntu or Linux Mint:

sudo apt install baobab

Fedora:

sudo dnf install baobab

Scan your home folder first. Look for old ISO downloads, duplicate archives, videos, VM disks or backup directories. An installation requires some free space, so if the drive is completely full, begin with existing tools. The du command can help inspect directories without installing a graphical app.

Large does not mean disposable. Confirm what a file contains and whether it is your only copy. Remove unused virtual disks through the virtualization app when appropriate. Check the Trash after ordinary file deletion, but empty it only after reviewing its contents.

2. Clean downloaded package caches

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 6

Package caches contain downloaded installation files, not the installed applications themselves. Cleaning them can reclaim space, but you may need to download packages again for reinstallation or rollback. The amount recovered depends on what is actually cached.

DistributionCommandEffect
Debian / Ubuntu / Linux Mintsudo apt cleanClears downloaded package archives; does not uninstall apps.
Fedorasudo dnf clean allClears repository caches, including metadata that later commands may download again.
Arch-based systemssudo paccache -rBy default retains the three newest cached versions of each package.

On Arch, paccache comes from pacman-contrib. Run paccache -d to preview candidates before removal. See the paccache manual for retention options. Avoid wiping the entire cache if you may need an older package version.

For application caches, use the application's own controls where possible. Clear browser cache separately from cookies, saved passwords and site data. Do not delete arbitrary hidden folders in your home directory: some contain settings or valuable application data.

3. Review unused packages and old kernels

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 7

Unused dependency packages are different from downloaded archives: removing them changes installed software. Review the proposed list before confirming a transaction.

DistributionReview stepRemoval step
Debian / Ubuntu / Linux Mintsudo apt-get --simulate autoremovesudo apt autoremove, after checking the list
FedoraReview the transaction proposed by sudo dnf autoremoveConfirm only packages you no longer need
Archpacman -Qdtq lists orphan packagessudo pacman -Rns package_name for deliberately selected packages

An orphan package may still be something you use directly. Do not remove a list blindly. The APT manual explains simulation and autoremove; adding --purge also removes applicable package configuration files and is not necessary for routine cleanup.

Keep the running kernel and a known-working fallback. Check the running version with uname -r. Linux Mint's Update Manager includes kernel management under View > Linux Kernels; use its supported removal controls. Other distributions manage retained kernels differently, and autoremove is not a universal kernel cleanup command.

4. Check systemd journal logs

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 8

On systems using the systemd journal, check its size:

journalctl --disk-usage

If old logs are taking substantial space, first preserve any records needed for troubleshooting. Then choose an appropriate retention limit. These example commands delete older archived journal files:

CommandWhat it does
sudo journalctl --vacuum-size=100MReduces archived journal storage toward 100 MB.
sudo journalctl --vacuum-time=3dRemoves archived journal files older than three days.

These are examples, not recommended limits for every system. Active journal files are excluded from vacuuming, so total usage may remain above the size limit. The journalctl manual explains that distinction. Journald also has retention settings; it does not necessarily grow without limits.

If logs quickly refill, investigate repeated errors rather than repeatedly deleting the evidence. Other applications may keep separate logs that journalctl does not manage.

5. Manage Timeshift snapshots through Timeshift

Don't rush to spend money on upgrades: Do this when your Linux storage is running low! Picture 9

Timeshift protects system files and settings. By default it excludes personal files in home directories, so it does not replace a separate document backup. Its documentation explains the exclusions.

Open Timeshift, inspect the snapshot list and remove only restore points you no longer need. Keep a suitable working restore point. Adjust scheduled retention to fit the available drive space rather than allowing unnecessary snapshots to accumulate.

If the graphical interface cannot run, list snapshots first:

sudo timeshift --list

To delete one selected snapshot, replace SNAPSHOT_NAME with its exact name from that list:

sudo timeshift --delete --snapshot 'SNAPSHOT_NAME'

Do not manually delete snapshot directories or remove every restore point as a routine fix. Whether snapshots can be moved to another device depends on the snapshot mode and filesystem; use Timeshift's supported configuration.

After each cleanup, run df -h again. If the same directory grows rapidly, identify the responsible application. If necessary data genuinely exceeds the drive's capacity, a storage upgrade may still be appropriate. Understanding basic Linux commands helps you inspect the problem before taking action.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.