How to Clean your System and Free Up Space?

I always struggle with my system space being full and keep moving things around to other drives. How do you guys clean your systems and keep space?

I always run paru -Scc after updating. I compact my VMs disk after using them and will delete unused files / gibberish in my Downloads. Despite this my system keeps getting bigger and bigger. It’s not Downloads nor Documents, Pictures and etc.

Not much actually beyond occasional clearing of /var/cache/pacman/pkg (using paccache command line tool) and ~/.cache.

You might want to run something like ncdu in a terminal to see where the space is consumed in your system.

:eye: https://wiki.archlinux.org/title/System_maintenance#Clean_the_filesystem

2 Likes

Run this command in your home directory, it will give you the 15 directories that take the most disk space :

du -hsx */ | sort -rh | head -15
2 Likes

Looks like my ~/.cache is ~85GB and 50 of those are paru despite cleaning after updating. Is it safe to delete everything in that folder? My ~/.config is also ~9GB, but I’m kind of scared to play around in that one.

Is there a way to modify that command so it also lists hidden(.) folders?

I guess it should be fine to clean all those build files and build packages in there from time to time.

You can check one folder at a time.
You may have kept config files/folders after software that no longer exist in your system.
If you don’t plan on reinstalling them, then you could remove the conf file/folder.

Proceed with caution, of course.

1 Like

Did you already try ncdu?

It should show you .folders as well: ncdu ~/

while doing package management cleanup is a plus that will be little space gained back.

I clean my /.cache folder once a week. There is nothing in there that i need to keep saved.

I also keep larger files off my /home device and place them on external devices and then just symlink back to the home folder.

1 Like

It shows hidden folders, list all of them not the 15 firsts :

du -hsx */ | sort -rh

Backup your /etc/fstab file first.

Add this to /etc/fstab - just change sam to your user name.

Your .cache will be clean out on every shutdown.

# grep cache /etc/fstab
tmpfs		/home/sam/.cache	tmpfs	uid=1000,gid=1000,mode=750 0 0

More info here:

http://www.voleg.info/cache-tmpfs.html
3 Likes

Mostly on normal Arch system if you need space what you have to clean is:

  1. pacman cache
  2. journal cache
1 Like

If I were to bet, my money would be on 90+% of that being from one program. Probably some soy browser.

Or yay cache

1 Like

That did show . folders somehow du won’t show them. Looks like it’s mostly .local, .cache, .nuget, .rustup, .config. Well vmware and Videos haver a decent size, but I know what’s in there.

 841.6 GiB [###########] /Documents
. 273.1 GiB [###        ] /Games
  158.1 GiB [##         ] /Videos
. 103.7 GiB [#          ] /.local
   81.2 GiB [#          ] /.cache
   61.7 GiB [           ] /vmware
   28.4 GiB [           ] /.nuget
   10.8 GiB [           ] /Downloads
    9.7 GiB [           ] /xz2
    9.1 GiB [           ] /.rustup
    8.5 GiB [           ] /.config

Don’t mind the crazy Documents and Games size, there are drives mounted there :sweat_smile:

I don’t even have slack installed anymore and it’s one of the bigger ones. And seems about right with the browsers.

1.9G	Signal/
1.4G	Slack/
878M	vivaldi/
873M	microsoft-edge/
812M	discord/
539M	Microsoft/
483M	protonmail/
389M	obs-studio/
335M	Code - OSS/
207M	Riot/
172M	OCS-Store/
154M	itch/
104M	Teams for Linux/
65M	retroarch/
60M	webex-teams-nativefier-ff9bb8/

Looks you may need to do some spring cleaning in there :slightly_smiling_face:

1 Like

Go use gparted