How to Free Up Disk Space on Fedora When Root Partition Is Full

Reclaim disk space on a full Fedora root partition by cleaning the DNF cache, removing old kernels, pruning journal logs, and uninstalling unused packages.

You run sudo dnf upgrade and the transaction aborts with Error: No space left on device. Or your desktop freezes because the journal cannot write, leaving you staring at a black screen with a blinking cursor. The root partition is full. Services are dying. You cannot install anything. You need space, and you need it now.

What is actually happening

The root partition holds the operating system, configuration files, logs, and package caches. When usage hits 100%, the filesystem refuses new writes. dnf cannot download or install updates. systemd cannot rotate logs. Applications crash because they cannot create temporary files. This is not a warning. This is a hard stop. The system is effectively locked out of its own storage.

Recovering space requires removing data that is no longer needed. Start with safe, high-impact operations. Move to investigation only if the quick wins are insufficient.

Clean the DNF package cache

The package manager keeps a local copy of every RPM you download. These files sit in /var/cache/dnf and serve no purpose once the package is installed. Clearing the cache is the fastest way to reclaim space without touching active data.

Here is how to purge the cache and free space immediately.

sudo dnf clean all # Remove cached RPMs, metadata, and headers from /var/cache/dnf
# This frees space instantly. The cache repopulates automatically on the next download.
# Running this does not affect installed packages or system stability.

Run dnf clean all before you panic. The cache is disposable.

Remove old kernel versions

Fedora retains multiple kernel versions to allow rollback if a new kernel breaks hardware. Over time, these accumulate. Each kernel plus its modules consumes significant space, often 200 to 400 MB per version. You can safely remove older versions while keeping the current kernel and the immediate predecessor.

Here is how to list installed kernels and remove the excess.

rpm -qa kernel | sort # List installed kernel packages to verify versions
# Review the output. The top entries are the newest kernels.
sudo dnf remove --oldinstallonly --setopt installonly_limit=2 kernel # Remove all kernels except the two most recent
# installonly_limit=2 keeps the running kernel and one backup.
# This flag prevents accidental removal of the kernel you are currently using.

Keep two kernels. One for running, one for rollback. Delete the rest.

Trim systemd journal logs

The systemd journal stores boot and service logs in /var/log/journal. Without limits, these logs can grow until they fill the disk. Vacuuming the journal removes old entries while preserving recent history for debugging.

Run journalctl -xe to read logs with explanatory text. The x flag adds priority annotations and the e flag jumps to the end. Most sysadmins type journalctl -xeu <unit> to isolate service failures.

Here is how to check journal size and vacuum old entries.

journalctl --disk-usage # Show total size of journal files on disk
# Note the size. If it is several gigabytes, vacuuming will recover significant space.
sudo journalctl --vacuum-time=2weeks # Delete log entries older than two weeks
# This keeps recent logs for troubleshooting while shedding historical data.
sudo journalctl --vacuum-size=200M # Cap total journal size at 200 megabytes
# Use size-based vacuuming if time-based retention is too unpredictable for your workload.

Vacuum the journal. Logs are history, not treasure.

Remove unused packages and dependencies

Dependencies installed for a package that you later removed often linger on the system. dnf autoremove identifies and deletes these orphaned packages. Always preview the removal list before confirming.

Here is how to safely remove orphaned packages.

sudo dnf autoremove --dry-run # Preview packages that will be removed
# Review the list carefully. Ensure no packages you need are marked for removal.
sudo dnf autoremove # Remove packages that were installed as dependencies but are no longer needed
# This may remove packages you explicitly installed if they are now dependencies of nothing.
# Confirm the transaction only after verifying the dry run output.

Review the dry run. Autoremove can delete packages you forgot you installed.

Remove unused locale data

Fedora ships with locale data for many languages. If you only use one language, the others are dead weight. Removing unused locales frees space in /usr/share/locale. The localepurge tool manages this safely by updating package configuration to prevent reinstallation.

Here is how to install and run localepurge.

sudo dnf install localepurge # Install tool to manage locale removal
sudo localepurge # Run interactive wizard to select locales to keep
# localepurge updates the package configuration to prevent reinstallation of removed locales.
# This is safer than manually deleting files in /usr/share/locale.

Remove locales you never use. They sit in /usr/share/locale and never get touched.

Find large files and directories

If standard cleanup is not enough, you need to find what is consuming space. Large files often hide in /var or /tmp. Use du to scan directories and sort by size.

Here is how to scan for large directories in common locations.

sudo du -sh /var/* | sort -rh | head -20 # List top 20 largest items in /var
# Look for unexpected growth in /var/log, /var/cache, or /var/lib.
sudo du -sh /usr/share/* | sort -rh | head -10 # List top 10 largest items in /usr/share
# Large language packs or documentation sets may appear here.

Scan /var first. Caches and logs hide there.

Check for orphaned temporary files

Temporary directories and orphaned files can accumulate. Check /tmp and /var/tmp for large files that should have been cleaned up. systemd-tmpfiles usually handles /tmp cleanup, but manual intervention may be needed if the service failed.

Here is how to find large temporary files.

sudo find /var/tmp /tmp -size +100M -type f -mtime +7 # Find files larger than 100MB older than 7 days
# Delete files only if you are certain they are not in use by a running process.
# Use `lsof` to check for open file handles before deleting.

Delete temporary files only when you are sure nothing is using them.

Prevent recurrence

Once you have space, configure limits to prevent the disk from filling up again. The journal is the most common culprit for silent growth. Set permanent limits in the configuration file.

Config files in /etc are user-modified. Files in /usr/lib ship with packages. Edit /etc. Never edit /usr/lib. This rule applies to journal configuration as well.

Here is how to set journal size limits permanently.

[Journal]
SystemMaxUse=500M # Cap total journal size at 500 megabytes
SystemMaxFileSize=50M # Limit individual log file size
# Edit /etc/systemd/journald.conf. Never edit /usr/lib/systemd/journald.conf.
# Uncomment the lines and set values appropriate for your disk size.
sudo systemctl restart systemd-journald # Apply new journal limits immediately
# The journal will enforce these limits on future log writes.

Set limits in /etc. The system will enforce them automatically.

Verify free space

Run df -h / to check the result. You should see the usage percentage drop. If the usage is still above 90%, repeat the investigation or consider structural changes.

Here is how to verify the recovery.

df -h / # Display filesystem usage for the root partition
# Verify that available space has increased and usage percentage has decreased.
# If usage is still critical, check for inode exhaustion or structural limits.

Check df -h after every step. Small wins add up.

Common pitfalls

A full inode table stops writes just like a full disk. If df -h shows available space but you cannot create files, check inodes.

mkdir: cannot create directory: No space left on device

This error can indicate inode exhaustion even when disk blocks are free. Run df -i / to check inode usage. If inodes are at 100%, you have too many small files. Remove empty directories or large numbers of tiny files in /var/log or /tmp.

Do not delete files in /var/lib/dnf or /var/lib/rpm. These directories contain the package manager database. Corrupting them breaks dnf and requires a database rebuild. Use dnf clean all instead of manual deletion.

If the root partition is structurally too small for your workload, cleanup will only buy temporary relief. Consider extending the logical volume if you have unallocated space in the volume group.

When to use this vs alternatives

Use dnf clean all when you need immediate space recovery with zero risk to system state.

Use dnf remove --oldinstallonly when kernel versions have accumulated and you want to reclaim hundreds of megabytes safely.

Use journalctl --vacuum-time when log growth is the primary consumer and you want to retain recent history for debugging.

Use dnf autoremove when you have removed large applications and want to clean up their abandoned dependencies.

Use localepurge when you are running a minimal installation and locale data is consuming disproportionate space.

Use lvextend when the root partition is structurally too small for your workload and you have unallocated space in the volume group.

Use a separate /var mount when logs and caches grow faster than the root partition can accommodate.

Where to go next