Fedora can feel roomy right after installation, but that comfort often fades as updates, app installs, and temporary files accumulate. When storage starts to run low, the problem is usually not one large file but a collection of smaller items such as package cache, system logs, unused dependencies, user cache, trash, temporary folders, and older kernels.
That is why cleanup on Fedora works best when it focuses on built-in tools. These commands help reclaim space without relying on third-party cleaners, which keeps the process simple and safer for the system.
1. Start with the package cache
One of the quickest ways to recover space is to clear DNF cache data with sudo dnf clean all. This removes stored package files and repository metadata under /var/cache/dnf, which can grow large over time.
The tradeoff is minor: the next update or install may take a bit longer because Fedora must download metadata again. Even so, it is a practical step after major update cycles.
2. Remove packages that are no longer needed
Installed applications often leave behind dependencies that no other package still uses. Fedora can clean those out with sudo dnf autoremove, which checks for packages that have become unnecessary.
For a quick preview before removal, sudo dnf repoquery --unneeded can show which packages may be safe to drop. This is useful when storage pressure comes from older apps that were removed long ago.
3. Trim down system logs
System logs are valuable for troubleshooting, but they can expand quickly on active machines or systems used for testing. Fedora’s journal can be reduced with sudo journalctl --vacuum-size=200M, which keeps logs at or below 200 MB.
A time-based option also exists: sudo journalctl --vacuum-time=2d keeps only the last two days of entries. Either method helps when logs have grown into several gigabytes.
4. Empty the Trash completely
Files deleted through the file manager often remain in ~/.local/share/Trash/, so they still occupy disk space. Running rm -rf ~/.local/share/Trash/* clears that folder and can return space immediately.
This command is permanent, so the contents should be checked first. It is especially helpful when large files were recently moved to Trash instead of being permanently deleted.
5. Clear persistent temporary files
Fedora treats /tmp and /var/tmp differently. The /tmp directory is usually cleaned automatically during boot, while /var/tmp stores temporary files that can survive restarts.
Because of that, /var/tmp may collect leftover installation files, partial downloads, or incomplete process data. The command sudo rm -rf /var/tmp/* can clear it, but it should not be used while updates or installations are still running.
6. Remove older user cache
Browser data, desktop environment files, and application cache often live in ~/.cache. These files can help performance, but older unused ones may take up more room than necessary.
A safer approach is find ~/.cache -type f -atime +30 -delete, which targets files that have not been accessed in the last 30 days. This keeps recent cache in place while removing stale data.
7. Delete old kernels carefully
Fedora keeps several kernel versions as backups in case the newest one causes problems. A single kernel, along with its modules and initramfs, may take roughly 200 to 400 MB, so old versions can consume a noticeable amount of storage.
To keep only the active kernel and one previous version, sudo package-cleanup --oldkernels --count=2 can be used. If the utility is missing, sudo dnf install yum-utils may be needed first, but anything tied to /boot should always be handled with caution.
Built-in commands worth remembering
| Command | Main function | Main risk |
|---|---|---|
sudo dnf clean all |
Clears DNF cache | Next update may be slower |
sudo dnf autoremove |
Removes unused dependencies | Low risk if packages are truly unneeded |
sudo journalctl --vacuum-size=200M |
Limits journal size | Older logs are removed |
rm -rf ~/.local/share/Trash/* |
Empties Trash | Permanent deletion |
sudo rm -rf /var/tmp/* |
Clears persistent temp files | Avoid during active installs |
find ~/.cache -type f -atime +30 -delete |
Deletes old user cache | May slow first access |
sudo package-cleanup --oldkernels --count=2 |
Removes old kernels | Requires extra caution |
Directories such as /boot, ~/.config, and /var/log should not be cleaned randomly because they contain active system files, configuration data, and logs that Fedora still needs. Using Fedora’s own cleanup commands keeps storage under control while limiting the chance of breaking something important.
