Low on storage. Help needed

Hi all.
Got a message of being low on storage. Checked the pop-up message; attached below.
Is there something to get rid-of safely ? I run a very slim Ubuntu 24.04
Are previous updates getting rid of old/obsolete useless versions or still occupy space ? Please guide me as for a beginner unskilled user.
I emptied the ‘garbage’ and message persists. See too much ‘snaps’ that I do not even know what they are, and too many ‘lib’ which I do not know what are those for.

Thanks for educating me.

Snaps are the applications in snap format you installed, if you click on the label “snapd” you can see the space used by each snap app. Then click on the label “var” and check if you have much space occupied by “log”
In any case if you install many applications in snap format 27GB are few for Ubuntu 24.04.

You have a very large /var folder in your file system, 16GB, whereas mine is just 2.4GB so I suggest you see if you can find the reason for this.
It will probably be one or more runaway log files in /var/log so look to see if there is one or more large log files in there and then we can explore what is the reason for this.
Snap applications can use more space than .deb versions of the same applications but that does not seem to be your problem.

However, I do agree with corradoventu that your 27GB is probably insufficient for successfully running Ubuntu as a main OS; it might run at the start but will very quickly fill with your data files which currently use just 5GB.

1 Like

/var is the place where the system stores changing data files (as opposed to static system data files which live in /usr/share/). These are made up of system wide application data files e.g. database server tables, caches, and logs. snap packages are also store in /var.

snap packages keep two old revisions on disk so you can roll back in case an updated version doesn’t work. You can tell it to keep only one backup by entering ‘snap set system refresh.retain=2’ (the ‘2’ means: keep the current version and one before it). After telling it to keep only one revision, you might have to remove the old revisions by using ‘snap list --all’ to see all the snaps and then use ‘snap remove --revision ’ e.g. ‘snap remove --revision 1533 gtk-common-themes’.

apt does keep a cache of downloaded packages in ‘/var/cache/apt/archives/’. ‘sudo apt clean’ removes all files from that cache. Unless you’re in the habit of uninstalling and reinstalling the same packages, removing these should be mostly harmless.

Which leaves the logs. Large logfiles are a sign that something is going wrong. The largest usually is /var/log/syslog and /var/log/syslog.1. If these are bigger than 5 Megabyte something is probably wrong. I say probably because the size of a log depends heavily on your use of the system. A heavily used system produces bigger logs than one which only runs for an hour or two on every other day. Just deleting logs doesn’t make your problems go away. Taking a look at their content might at least tell you what is producing a lot of entries and why. They are simple text files.

Another thing is the journal. This is the primary logging system, the text logs are mostly a backup (the journal is stored in a binary format that’s hard to read without the right tools; reading the logs of a crashed system is usually the way you find out what went wrong, so that’s the reason to keep the text logs in addition to the binary journal). The journal is stored in files under /var/log/journal/ but directly manipulating them is a really bad idea. The interface to the journal is the journalctl command. It’s not only used for viewing the journal, you can also use it to shrink the journal by using the --vacuum-… options possibly together with the --rotate option e.g. ‘sudo journalctl --rotate --vacuum-size=1G’ would close the existing journal files, create new ones and throw out old entries until the size is 1 gigabyte. You also change the behaviour of the journal system by changing the configuration in /etc/systemd/journald.conf. There is a manual page for this file and the options you can put in there.

2 Likes

Thanks for your effort, gentlemen. Am totally unskilled to follow your expertise.
Can guess some terminal commands suggested in your responses but will be not understanding what am doing.

Checking the SSD 32GB drive, there is a 1MB partition1, a partition2 shows FAT32??? with 8 MB used; and the attached image for partition3.
If you have the patience; tell me in words for an idiot, what to do to clarify. Usually can operate the terminal fine to obey your instructions, but my lucidity is fading fast.

I changed your title because “Anything scary here?” is way too generic of a title. I have made it a little more specific to the low storage space issue.

1 Like

Hey there @innernet :cowboy_hat_face:

I noticed that you have about 32GB of storage, I wouldn’t recommend that much of storage myself, because when I have things to do, such as doing business or making games/movies :frowning_with_open_mouth:, I would recommend 1TB of storage or larger “SSD is recommended but HDD is fine”.

Here’s a hard drive that I found it for you and if you don’t want to buy it, that’s okay because I’m not making you have to do it. However, if that drive is too expensive to you, you can find a cheaper one if you want, your device it’s part of your property, you can do what you want with it. :wink:

If that didn’t solved issues for you, that’s too bad. :disappointed_relieved:
Unfortunately, Ubuntu requires 25GB as a minimum and probably 32GB or larger would be recommended “Which I can’t help you with that”, but it may explain why Ubuntu provides two sets of installation.

Example: Minimal Installation and Expanded Installation.


Do note that Minimal installation since 23.10 is the default, by the way.

What happens if you run sudo apt autoclean ?

When performing the command you suggest; I get three ‘done’ with no explanation of what happened or if succeeded in liberating space. How to find the difference to the previous “low on storage” condition ?

Screenshot from 2025-02-16 08-09-51

If you have sufficient RAM and does not run too much apps together you may remove the swap.img. what does the free command say?
Try also apt autoremove --purge
Check also the space used by your snap apps:
sudo lsblk -o NAME,LABEL,SIZE,FSTYPE,MOUNTPOINT

Thanks. Results:


In my ignorance; am convinced there is 90% of useless contents in the drive that do not get purged. I run an extremely lean machine with very few applications I hardly use and open 3 or 4 maximum tabs in a session.
How to delete what to see if that liberates space? I can buy a bigger drive/storage if really needed after trying to get rid of the bloaters.

Do I proceed with " Try also apt autoremove --purge " or not yet ?

I believe it’s more than just snaps that are contributing to the problem.

In Disk Usage Analyzer, expand “var” and let us see which folders are filling up.

also, “free -h” will give the sizes in kb, mb, gb

Yes, proceed with sudo apt autoremove --purge it can’t do any harm.
The partition2 FAT32 is used for boot, can’t be removed!

As suggested by hdd-gehrke you may try to remove unused old snaps but i’m not sure your multiple copies of /snap/gnome will be considered duplicates.

Expanding ‘var’
Screenshot from 2025-02-16 09-25-51

and " -h "

Check also space in /var/log: ls /var/log -lh

externet@externet-ThinkPad-T430s:~$ ls /var/log -lh
total 38M
-rw-r–r-- 1 root root 0 Feb 1 09:00 alternatives.log
-rw-r–r-- 1 root root 4.1K Jan 28 20:06 alternatives.log.1
-rw-r–r-- 1 root root 239 Apr 20 2024 alternatives.log.10.gz
-rw-r–r-- 1 root root 504 Mar 27 2024 alternatives.log.11.gz
-rw-r–r-- 1 root root 427 Feb 29 2024 alternatives.log.12.gz
-rw-r–r-- 1 root root 137 Dec 28 09:01 alternatives.log.2.gz
-rw-r–r-- 1 root root 375 Nov 30 11:25 alternatives.log.3.gz
-rw-r–r-- 1 root root 458 Oct 19 11:09 alternatives.log.4.gz
-rw-r–r-- 1 root root 377 Sep 21 21:34 alternatives.log.5.gz
-rw-r–r-- 1 root root 2.6K Aug 31 22:22 alternatives.log.6.gz
-rw-r–r-- 1 root root 178 Jul 2 2024 alternatives.log.7.gz
-rw-r–r-- 1 root root 360 Jun 7 2024 alternatives.log.8.gz
-rw-r–r-- 1 root root 220 May 10 2024 alternatives.log.9.gz
-rw-r----- 1 root adm 0 Feb 16 07:52 apport.log
-rw-r----- 1 root adm 115 Feb 15 11:02 apport.log.1
-rw-r----- 1 root adm 122 Feb 4 20:26 apport.log.2.gz
-rw-r----- 1 root adm 248 Jan 30 15:00 apport.log.3.gz
-rw-r----- 1 root adm 301 Jan 24 20:26 apport.log.4.gz
-rw-r----- 1 root adm 145 Jan 23 10:29 apport.log.5.gz
-rw-r----- 1 root adm 290 Dec 30 12:01 apport.log.6.gz
-rw-r----- 1 root adm 248 Dec 28 09:21 apport.log.7.gz
drwxr-xr-x 2 root root 4.0K Feb 1 09:00 apt
-rw-r----- 1 syslog adm 5.4K Feb 16 09:30 auth.log
-rw-r----- 1 syslog adm 141K Feb 16 07:52 auth.log.1
-rw-r----- 1 syslog adm 12K Feb 9 10:26 auth.log.2.gz
-rw-r----- 1 syslog adm 14K Feb 1 23:59 auth.log.3.gz
-rw-r----- 1 syslog adm 12K Jan 26 09:28 auth.log.4.gz
-rw------- 1 root root 0 Jan 31 10:04 boot.log
-rw------- 1 root root 16K Jan 31 10:04 boot.log.1
-rw------- 1 root root 12K Jan 25 10:07 boot.log.2
-rw------- 1 root root 12K Dec 29 03:51 boot.log.3
-rw------- 1 root root 12K Dec 15 10:02 boot.log.4
-rw------- 1 root root 12K Dec 1 06:23 boot.log.5
-rw------- 1 root root 12K Nov 3 08:34 boot.log.6
-rw------- 1 root root 12K Oct 20 09:52 boot.log.7
-rw-r–r-- 1 root root 106K Apr 19 2022 bootstrap.log
-rw-rw---- 1 root utmp 0 Feb 1 09:00 btmp
-rw-rw---- 1 root utmp 768 Jan 30 15:00 btmp.1
drwxr-xr-x 2 root root 4.0K Feb 16 07:52 cups
drwxr-xr-x 2 cups-browsed lpadmin 4.0K Aug 31 22:17 cups-browsed
drwxr-xr-x 2 root root 4.0K Aug 31 22:21 dist-upgrade
-rw-r----- 1 root adm 84K Jan 30 15:00 dmesg
-rw-r----- 1 root adm 82K Jan 24 19:00 dmesg.0
-rw-r----- 1 root adm 22K Dec 28 09:21 dmesg.1.gz
-rw-r----- 1 root adm 22K Dec 14 02:24 dmesg.2.gz
-rw-r----- 1 root adm 22K Nov 30 11:27 dmesg.3.gz
-rw-r----- 1 root adm 22K Nov 2 20:44 dmesg.4.gz
-rw-r–r-- 1 root root 0 Feb 1 09:00 dpkg.log
-rw-r–r-- 1 root root 56K Jan 28 20:06 dpkg.log.1
-rw-r–r-- 1 root root 7.9K Apr 30 2024 dpkg.log.10.gz
-rw-r–r-- 1 root root 6.7K Mar 27 2024 dpkg.log.11.gz
-rw-r–r-- 1 root root 5.4K Feb 29 2024 dpkg.log.12.gz
-rw-r–r-- 1 root root 8.5K Dec 28 09:01 dpkg.log.2.gz
-rw-r–r-- 1 root root 7.7K Nov 30 11:26 dpkg.log.3.gz
-rw-r–r-- 1 root root 11K Oct 29 20:19 dpkg.log.4.gz
-rw-r–r-- 1 root root 5.2K Sep 21 21:34 dpkg.log.5.gz
-rw-r–r-- 1 root root 139K Aug 31 22:23 dpkg.log.6.gz
-rw-r–r-- 1 root root 3.6K Jul 31 2024 dpkg.log.7.gz
-rw-r–r-- 1 root root 6.2K Jun 29 2024 dpkg.log.8.gz
-rw-r–r-- 1 root root 9.4K May 30 2024 dpkg.log.9.gz
-rw-r–r-- 1 root root 18M Aug 31 22:17 faillog
-rw-r–r-- 1 root root 14K Dec 14 00:51 fontconfig.log
drwx–x–x 2 root gdm 4.0K Mar 17 2023 gdm3
-rw-r–r-- 1 root root 1.5K Jan 30 15:00 gpu-manager.log
drwxr-xr-x 3 root root 4.0K Apr 19 2022 hp
drwxr-xr-x 2 root root 4.0K Mar 17 2023 installer
drwxr-xr-x 2 root root 4.0K Nov 5 2023 ipp-usb
drwxr-sr-x+ 3 root systemd-journal 4.0K Mar 17 2023 journal
-rw-r----- 1 syslog adm 381K Feb 16 09:30 kern.log
-rw-r----- 1 syslog adm 13M Feb 16 07:52 kern.log.1
-rw-r----- 1 syslog adm 371K Feb 9 10:26 kern.log.2.gz
-rw-r----- 1 syslog adm 160K Feb 2 00:00 kern.log.3.gz
-rw-r----- 1 syslog adm 1.2M Jan 26 09:28 kern.log.4.gz
-rw-rw-r-- 1 root utmp 163M Aug 31 22:17 lastlog
drwxr-xr-x 2 root root 4.0K Mar 22 2022 openvpn
drwx------ 2 root root 4.0K Apr 19 2022 private
lrwxrwxrwx 1 root root 39 Aug 31 21:40 README → …/…/usr/share/doc/systemd/README.logs
drwx------ 2 speech-dispatcher root 4.0K Jan 8 2022 speech-dispatcher
-rw-r----- 1 syslog adm 417K Feb 16 09:30 syslog
-rw-r----- 1 syslog adm 20M Feb 16 07:52 syslog.1
-rw-r----- 1 syslog adm 572K Feb 9 10:26 syslog.2.gz
-rw-r----- 1 syslog adm 450K Feb 2 00:00 syslog.3.gz
-rw-r----- 1 syslog adm 1.4M Jan 26 09:28 syslog.4.gz
drwxr-xr-x 2 root root 4.0K Sep 30 09:09 sysstat
-rw-r–r-- 1 root root 0 Sep 1 09:22 ubuntu-advantage.log
-rw-r–r-- 1 root root 2.7K Aug 31 22:23 ubuntu-advantage.log.1
-rw-r–r-- 1 root root 1.9K Jun 7 2024 ubuntu-advantage.log.2.gz
-rw-r–r-- 1 root root 8.5K May 31 2024 ubuntu-advantage.log.3.gz
-rw-r–r-- 1 root root 8.9K Apr 30 2024 ubuntu-advantage.log.4.gz
-rw-r–r-- 1 root root 8.3K Mar 31 2024 ubuntu-advantage.log.5.gz
-rw-r–r-- 1 root root 5.7K Feb 29 2024 ubuntu-advantage.log.6.gz
-rw-r–r-- 1 root root 0 Aug 1 2023 ubuntu-advantage-timer.log
-rw-r–r-- 1 root root 4.0K Jul 18 2023 ubuntu-advantage-timer.log.1
-rw-r–r-- 1 root root 739 Jun 30 2023 ubuntu-advantage-timer.log.2.gz
-rw-r–r-- 1 root root 790 May 31 2023 ubuntu-advantage-timer.log.3.gz
-rw-r–r-- 1 root root 942 Apr 30 2023 ubuntu-advantage-timer.log.4.gz
-rw-r–r-- 1 root root 463 Mar 31 2023 ubuntu-advantage-timer.log.5.gz
drwxr-x— 2 root adm 4.0K Jul 1 2024 unattended-upgrades
drwxr-xr-x 2 root root 4.0K Aug 31 22:23 upgrade
-rw-rw-r-- 1 root utmp 143K Jan 30 15:01 wtmp
externet@externet-ThinkPad-T430s:~$

Many of the above results show in red and blue but copying to paste here eliminates colors. Too large to show as screenshot, partial image :

You have a lot of old small logs in /var/log so:

cd /var/log
sudo rm *.gz

Done that :
Screenshot from 2025-02-16 09-43-44

As has been suggested above, your /var/log directory is 16GB. You need to delete (using sudo) the various log file to free up space. Use du -h /var/log to get the size of the various log files .