-1

I've allocated 30GB to Ubuntu when installing, but I'm recently getting a warning saying file system is running out of space Due to this my system is running slowly.

The results of df -h are:

Filesystem      Size  Used Avail Use% Mounted on
udev            1.6G     0  1.6G   0% /dev
tmpfs           330M  1.9M  328M   1% /run
/dev/sda6        29G   26G  1.7G  94% /
tmpfs           1.7G     0  1.7G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.7G     0  1.7G   0% /sys/fs/cgroup
/dev/loop0      128K  128K     0 100% /snap/bare/5
/dev/loop1      9.2M  9.2M     0 100% /snap/canonical-livepatch/126
/dev/loop2      9.0M  9.0M     0 100% /snap/canonical-livepatch/132
/dev/loop3      220M  220M     0 100% /snap/code/93
/dev/loop4      220M  220M     0 100% /snap/code/94
/dev/loop6      112M  112M     0 100% /snap/core/12941
/dev/loop5      111M  111M     0 100% /snap/core/12834
/dev/loop7       56M   56M     0 100% /snap/core18/2284
/dev/loop8       62M   62M     0 100% /snap/core20/1376
/dev/loop9       56M   56M     0 100% /snap/core18/2344
/dev/loop10      62M   62M     0 100% /snap/core20/1405
/dev/loop11     219M  219M     0 100% /snap/gnome-3-34-1804/72
/dev/loop12     248M  248M     0 100% /snap/gnome-3-38-2004/87
/dev/loop13     219M  219M     0 100% /snap/gnome-3-34-1804/77
/dev/loop15      66M   66M     0 100% /snap/gtk-common-themes/1515
/dev/loop14      45M   45M     0 100% /snap/snapd/15314
/dev/loop16      51M   51M     0 100% /snap/snap-store/547
/dev/loop17      66M   66M     0 100% /snap/gtk-common-themes/1519
/dev/loop19      89M   89M     0 100% /snap/xournalpp/69
/dev/loop20      44M   44M     0 100% /snap/snapd/15177
/dev/loop18      55M   55M     0 100% /snap/snap-store/558
/dev/loop21     249M  249M     0 100% /snap/gnome-3-38-2004/99
/dev/sda1       256M   34M  223M  14% /boot/efi
tmpfs           330M   44K  330M   1% /run/user/1000
/dev/sda4       701G   26G  675G  
karel
  • 122,292
  • 133
  • 301
  • 332
Vamshi
  • 1
  • 1

2 Answers2

1

Only you can know because you are the user of the system. You will need to investigate what is taking the space, and then clear the space. There is no one-fits-all answer here: how to cleanup will depend on what is taking the space.

The tool Disk Usage Analyser, that comes installed with the standard Ubuntu desktop, can help easily to identify which directories occupy most of the space. The command line tool du also allows to see that on the terminal.

  • If your user data, i.e. all data under the directory /home, are on that same partition, then the solution is easy: move user data out to other partitions to free space. You can tell /home is on the same partition if, in disk analyzer, there is no separate "device" for /home. (Next to your personal home directory, you will see at least one device for / when you start the program).
  • In the terminal, execute sudo apt clean. That will temporarily release a little space by deleting downloaded installation packages
  • In the terminal, execute sudo apt autoremove. That should remove all packages that are not anymore needed, but also remove old kernels: the latter can release 0.5 GB (which is about what a kernel needs) or more. After running this command, check the number of installed kernels with the command dpkg --list | grep linux-image. Appart from linux-image-generic, there should be no more than two linux-image-<version>... packages. If there are more, then you can manually remove the oldest ones, keeping the current kernel and the one but last.
  • System logs can become very large, especially (paradoxically) in a situation of low disk space. Methods to safely clean logs and keep their size limited are provided here, along with many other safe cleaning tips.
  • You may have an exceptionally large number of packages installed. For regular packages installed using the APT system, the incremental space used per packages is usually limited. However, snap packages take up significantly more space. While it is difficult to fill 30 GB with apps, if you managed to, then consider removing applications you do not use.
vanadium
  • 97,564
0

Use NCDU utility to investigate what is taking up your space and remove trash files

sudo apt install ncdu 
sudo ncdu

it is extremely user friendly and helpful