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:

  1. Close any Flatpak applications currently running on the system.

  2. Launch a terminal window

  3. Run the following command:

    $ echo sudo rm -rf /var/tmp/flatpak-cache-*
    
  4. Check the output of the command and verify that it is absolutely identical to what is written in the previous step of this guide.

  5. If it is identical:
    1. Press the “up” directional arrow key on the keyboard to show the previous command.

    2. Delete the text echo from the command.

    3. 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.

  1. Launch a terminal window

  2. 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:

  1. Launch a terminal window

  2. As root (or using sudo), modify the /etc/systemd/journald.conf file

    1. Locate the following line:

      #SystemMaxUse=
      
    2. Uncomment the line by removing the preceding # character

    3. Set a max threshold in MB (M), GB (G), etc. For example, a 512 MB max capacity is represented as:

      SystemMaxUse=512M
      
    4. Save the file

  3. Restart the journald service:

    $ sudo systemctl restart systemd-journald.service
    

The journal service will now never exceed the size of the configured capacity.

1

Source




Remove unneeded files

Digital Negative (DNG) image files

Digital negative files contain image data captured directly from the camera sensor. They comprise the highest, unmodified quality of any image taken using an integrated camera. After a DNG file is stored, an algorithm applies auto-brightness, contrast, and compression to the data and stores the image as a JPG file. Before removing any DNG files, please consider whether you require archival quality of any of these images.

Follow one of the following procedures to remove DNG files:

Graphical method
  1. Within the “Files” application, tap the file you wish to delete.

  2. From the “English (US)” keyboard layout (default), tap the “globe” icon directly to the right of the “123” button.

  3. Tap “Terminal” in the pop-up menu.

  4. To the left of the “Enter” button, tap the button called “>_”.

  5. Near the right side of the keyboard, tap the “Del” button. The file will be placed in the Trash.

  6. Optional: Tap the “ABC” button to return to the alphabetic keyboard.

Terminal method
  1. Launch a terminal window

  2. Run the following command:

    $ rm ~/Pictures/*.dng
    


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:

  1. Launch a terminal window

  2. Run the following command:

    $ flatpak uninstall --unused