sudo journalctl --vacuum-size=300M
reduces the logs to 300 MBsudo logrotate /etc/logrotate.conf
compresses or (?) deletes system logssudo apt-get autoremove
removes software that are only dependencies to packages you removed earlier and don’t need anymoresudo apt-get clean
this is nearly the same assudo rm -rf /var/cache/apt/archives/*
and deletes cached downloaded packages for installation. Running this during some installations could be a problem.- Deleting files from the trashbin
trash:/
and checking if there’s any large files that could be deleted in /tmp:find /tmp -type f -size +50M -exec du -h {} \; | sort -n
- Identifying largest files with a command like
sudo find / -mount -type f -size +100M -exec du -h {} \; | sort -n
(a few more are here and here) or with a GUI likegdmap
(Graphical Disk Map) and then either moving/deleting them or creating symbolic links.- For example, to create a symbolic link for the relatively large daily.cld file of ClamTk one could run
sudo mv /var/lib/clamav/daily.cld /home/username/Software/daily.cld
thensudo ln -s "/home/username/Software/daily.cld" "/var/lib/clamav/daily.cld"
so this also works for files used by software that expect the file to be in a specific location. Directories where one can commonly find large files include/opt/
.
- For example, to create a symbolic link for the relatively large daily.cld file of ClamTk one could run
Now let us shift focus on how you can free up the disk space using a few GUI applications in Ubuntu and Linux Mint distribution.
1. Stacer
Written in C++, Stacer is a free and open-source GUI application that monitors and optimizes your disk space. It provides an intuitive and appealing user interface that gives you a glance at usage statistics of your resources such as RAM, CPU, and disk utilization. In addition, it gives you information about your system information and bandwidth utilization.
Stacer provides a couple of useful features to manage processes, startup applications, system services, and uninstall applications. Worth noting is the system cleaner which gets rid of package caches that occupy huge amounts of disk space. In addition, it also empties the trash and clears crash reports, application caches, and logs, thus freeing up the disk space.
To install Stacer on your system, run the command:
sudo apt update sudo apt install stacer
2. Ubuntu Cleaner
Developed in Python, Ubuntu Cleaner is yet another GUI option that does a decent job of freeing up disk space on Ubuntu / Mint. The graphical tool cleans up the system by removing the following files:
- Old Linux kernels
- Browser cache
- Thumbnail cache
- Apps Cache
- APT cache
- Any unneeded packages
Ubuntu Cleaner is open-source and absolutely free to use.
To install Ubuntu cleaner, clone the git repository.
git clone https://github.com/gerardpuig/ubuntu-cleaner.git
Then update your package index and install the Ubuntu cleaner package as follows:
cd ubuntu-cleaner ./ubuntu-cleaner
3. BleachBit
Designed for both Windows and Linux systems, BleachBit is a free and open-source disk cleaner that quickly frees up your disk as your PC fills up with junk files.
With BleachBit, you can shred temporary files, delete cookies, clear internet history, and discard application log files and unneeded files in the system.
In addition, BleachBit acts as a cleaner for web browsers such as Firefox and Chrome to mention a few.
BleachBit is available in Ubuntu repositories and you can install it using the APT package manager as follows:
sudo apt update sudo apt install bleachbit
4. Sweeper
Native to the KDE desktop environment, Sweeper is a system cleaner application that clears your hard drive of junk files such as thumbnail cache, web browser junk such as cookies, web history, the temporary cache of visited websites, and also gets rids of files in your trash.
There are two ways of installing a Sweeper. You can install it from the official Ubuntu repository as follows:
sudo apt update sudo apt install sweeper
Additionally, you can install using Snap as shown. First, ensure that Snap is enabled on your system.
sudo apt update sudo apt install snapd
Next, install Sweeper.
sudo snap install sweeper --edge
5. rmLint
Last on the list is the rmLint tool. The tool traverses multiple directories and helps in identifying duplicate files and directories, broken symbolic links, and non-stripped binaries.
It doesn’t delete these files per se, but it generates executable output, such as JSON or shell scripts that you can use to delete the files. It scans files and directories and intelligently determines the duplicates. When duplicates are found, you can then proceed and delete them using auto-generated scripts.
To install rmLint, simply run the command:
sudo apt install rmlint
To launch the graphical interface, run the command:
rmlint --gui
That was a roundup of some of the most popular GUI tools that you can use to free up disk space in your Linux system.