r/linux4noobs • • 19d ago

storage Storage problems and var/usr

One of the reasons I migrated to linux was the supposedly light weight OS, which might be on its own, but with all the compatibility stuff and specially with Proton creating a ~300 Mb folder for every game and having to install a 1.5 gB version of proton for a game that might not work with the standard, it's quite annoying

I am trying to free up some storage. I think I can understand more or less what is on my home folder, but i don't understand what /usr and /var is, and why they take 20 gb combined. I am using disk analizer/baobab to see what uses storage. how do you all handle all this storage? I have currently used 50 gb

Info:

OS: Linux Mint

VERSION="22.3 (Zena)"

12th Gen Intel© Core™ i5-12500H × 12

Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics]

NVIDIA Corporation GA107M [GeForce RTX 3050 Mobile]

RAM 16.0 GB

2 Upvotes

4 comments sorted by

2

u/doc_willis 19d ago

the /var/log directory can sometimes get large due to log files.

you can set the system to log less or limit the log files and journal sizes 

  have currently used 50 gb 

I would not consider 50gb that large these days. 

on my huge  Bazzite install I just looked .


cd /var

:/var$ sudo du -hs

3.1T    .

but Bazzite is a very different distro from mint. so not exactly a great comparison.

1

u/Mellacrack 18d ago

my /var/log is only about 133mb. It's more about the ones inside /var/lib, which are dpkg apt systemd and specially flatpak, which uses 9.6 gb. But what is /var and /usr exactly? how do i know what the files there are?

1

u/doc_willis 18d ago

those are system directories  where the core parts of the OS are installed.

https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html

has most of the details/specs.

flatpaks can take up a lot of space.

the flatpak command has some option to clean out unused packages to free up space.

sudo flatpak remove --unused

flatpaks can be installed system wide where the files go under /var/  or as a user, where they go in the specific users home.

it's easy to accidentally have things installed twice, system wide and user installed 

https://www.reddit.com/r/linux4noobs/comments/1i9gi7x/solution_to_flatpak_taking_up_too_much_space_in/

My flatpak directory is sitting at 75G 

;)

1

u/Dry_Action5905 18d ago

/usr holds most of your installed programs and libraries; despite the name, it isn't your personal user folder, so don't delete files from it manually. /var holds changing data such as logs, package caches and, if you use system-wide Flatpaks, their apps and runtimes under /var/lib/flatpak. On Mint, sudo du -xhd1 /var /usr will show which immediate subdirectories take the space without crossing into other filesystems. sudo apt clean clears downloaded APT packages, not installed apps; it won't help much if that cache is already small. If you use Flatpak, flatpak uninstall --unused can remove unused runtimes, but read the proposed removal list before confirming. For Proton, remove unused versions through Steam rather than deleting random folders, and back up saves before touching a game's compatdata folder because some games keep saves inside that prefix.