.. include:: /substitutions.rst .. include:: /urls.rst .. _pureos_cleanup: Reclaim disk space ================== .. _pureos_cleanup_cache: Clear the cache --------------- .. _pureos_cleanup_cache_flatpak: 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. #. :ref:`Launch a terminal window ` #. Run the following command: .. code-block:: bash $ 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. |br| .. _pureos_cleanup_cache_user: User cache ~~~~~~~~~~ An easy way to reclaim a substantial amount of disk space is to clear the cache in a user's home directory. #. :ref:`Launch a terminal window ` #. Run the following command: .. code-block:: bash $ rm -rf ~/.cache/* The user cache is now cleared. |br3| .. _pureos_cleanup_limit_journal: 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 [#]_: #. :ref:`Launch a terminal window ` #. As root (or using ``sudo``), modify the ``/etc/systemd/journald.conf`` file #. Locate the following line: .. code-block:: #SystemMaxUse= #. Uncomment the line by removing the preceding ``#`` character #. Set a max threshold in MB (M), GB (G), etc. For example, a 512 MB max capacity is represented as: .. code-block:: SystemMaxUse=512M #. Save the file #. Restart the ``journald`` service: .. code-block:: bash $ sudo systemctl restart systemd-journald.service The journal service will now never exceed the size of the configured capacity. .. [#] `Source `_ |br3| .. _pureos_cleanup_remove_files: Remove unneeded files --------------------- .. _pureos_cleanup_remove_files_flatpak: 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: #. :ref:`Launch a terminal window ` #. Run the following command: .. code-block:: bash $ flatpak uninstall --unused