Reclaim disk space¶
Clear the cache¶
Flatpak cache¶
If Flatpak applications are installed on the system, Flatpak cache files may accumulate and consume unnecessary disk space. To remove Flatpak cache files:
Close any Flatpak applications currently running on the system.
Run the following command:
$ echo sudo rm -rf /var/tmp/flatpak-cache-*
Check the output of the command and verify that it is absolutely identical to what is written in the previous step of this guide.
- If it is identical:
Press the “up” directional arrow key on the keyboard to show the previous command.
Delete the text
echo
from the command.Press Enter to run the command.
The Flatpak cache is now cleared.
User cache¶
An easy way to reclaim a substantial amount of disk space is to clear the cache in a user’s home directory.
Run the following command:
$ rm -rf ~/.cache/*
The user cache is now cleared.
Limit the maximum capacity of the system journal¶
If left at default values and not checked for a long time, the system journal logs can eventually consume multiple Gigabytes of data. To set the maximum allowable size of the system journal logs 1:
As root (or using
sudo
), modify the/etc/systemd/journald.conf
fileLocate the following line:
#SystemMaxUse=
Uncomment the line by removing the preceding
#
characterSet a max threshold in MB (M), GB (G), etc. For example, a 512 MB max capacity is represented as:
SystemMaxUse=512M
Save the file
Restart the
journald
service:$ sudo systemctl restart systemd-journald.service
The journal service will now never exceed the size of the configured capacity.
Remove unneeded files¶
Flatpak¶
If Flatpak applications are installed on the system, outdated software dependencies may potentially accumulate and consume unnecessary disk space. To remove dependencies no longer needed by Flatpak applications that are installed on the system:
Run the following command:
$ flatpak uninstall --unused