How to best clean up storage space?

My YunoHost server

Hardware: VPS bought online
YunoHost version: 4.3.6.3
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Hi
I have setup a test installation on a small vps (20 gb), I have installed and uninstalled various applications and now I’m getting into storage space issues, the 20 gigs are completely used. However, I don’t have a lot of data there, I’m using Nextcloud with Collabora, have installed some other apps like funkwhale (without significant content of course), wallabag, netdata etc.).
I wonder if there is a way to delete some directories / files without risk. Are there any logs / remains from deinstalled apps / where could I find them / where should I search?
I have tried to analyse it a bit with du, I see that /var uses almost half of the space, and /var/cache/apt again half of this, there seem to be all the dep packages.

I’m not a Linux pro, so I don’t really know a lot about storage clean up on linux / yunohost. So maybe there are some easy principles for linux which are relevant for yunohost as well?

Thanks for the great product!

Yeah that’s a classic one, this is apt’s cache where it stores the .deb (= software packages) before installing them so that it doesn’t re-download everything everytime you call apt upgrade and other things. That said, many files in the cache are often not necessary anymore and you can safely clean them with sudo apt clean (the worst that can happen is that it will redownload a bunch of file if it needs them)

Thanks, so I could free 4gb of space at least. If there are any other tips, I would be glad. I suppose there are some remains from previous app installations which could be cleaned up or maybe not because of possible dependencies which will break yunohost?

Older app installs are supposed to be cleanedup automatically so I don’t think there’s that much to gain …

Possibly you can try apt autoremove which may uninstall old, uneeded dependencies

Otherwise I would try to run ncdu which is a better version of du which allows to scan and interactively browse the filesystem while seeing what uses space etc. You can install it with apt install ncdu then just launch ncdu / to analyze the full filesystem

2 Likes

alright, didn’t know ncdu, much easier than du.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.