Clean Up a Linux System to free up disk space

Clean Journal Log

Can we remove files from the /var/log/journal folder? Yes, indeed. It’s completely fine as long as you don’t require the logs for troubleshooting.

Determine how much disc space /var/log/journal consumes

Run this command in your terminal to see how much space is taken up by log files.

sudo journalctl --disk-usage

You will see something like this

Archived and active journals take up 4.0G in the file system.

Clear (reduce) the folder size instantly

Let’s say you want to reduce the log size to a specific size. Let’s then delete old log files from the /var/log/journal folder and reduce the folder size to 100 MB.

sudo journalctl --vacuum-size=100M

You will see something like this

Deleted archived journal /var/log/journal/a507f97b935f4660bfd8ef6e1aa296d4/system@868984e0359c48dbbf3abb3f0adde391-0000000003055c74-0006023627fd12d6.journal (72.0M).
Vacuuming done, freed 3.8G of archived journals from /var/log/journal/a507f97b935f4660bfd8ef6e1aa296d4.

Clean apt Cache

Run this command in your terminal to clear apt cache

sudo apt-get clean
free up disk space

Disk space analyzer

Run this command in your terminal to install terminal based disk space analyzer called “ncdu

sudo apt-get install ncdu

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top