Free Up Space on Ubuntu

1. Clean the APT Cache (and do it regularly)

Check how big your apt cache is

sudo du -sh /var/cache/apt/archives

Clean the apt cache

sudo apt-get clean

2. Remove Old Kernels (if no longer required)

sudo apt-get autoremove --purge

3. Get rid of packages (if no longer required)

sudo apt-get autoremove

4. Clear systemd journal logs

Check the log size

journalctl --disk-usage

Clear the logs that are older than a certain days (3days in this example!!)

sudo journalctl --vacuum-time=3d

5. Clean the thumbnail cache

  • Ubuntu automatically creates a thumbnail, for viewing in the file manager.

  • It stores those thumbnails in a hidden directory in your user account at the location ~/.cache/thumbnails.

Check the size of thumbnail

du -sh ~/.cache/thumbnails

Clear the thumbnail cache (every few months or so!)

rm -rf ~/.cache/thumbnails/*

Last updated