contacts

Get All 146 Premium WordPress Themes for Just $59.99
One-Time Payment: Unlimited Use Across Unlimited Domains, Plus Free Lifetime Updates! Learn more

How to Free up Space on Ubuntu

How to Free up Space on Ubuntu

I like to keep my Laptop SSD tidy. So, from time to time I clean up unnecessary files using a few Ubuntu/Linux terminal commands:

Clean up No More Required Packages

$ sudo apt-get autoremove

Clean up Outdated Packages

$ sudo apt-get autoclean

Clean up Old System Journal Logs

$ sudo journalctl --vacuum-time=2d

Remove Old Snap App Versions

save below as file and execute it with sudo:

set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
        snap remove "$snapname" --revision="$revision"
    done

Clean up Image Thumbnails

$ rm -rf ~/.cache/thumbnails/*