I am getting frequently low disk space message

I am frequently getting low disk space error and attached screen displayed.

Let me know what to do.


Solution 1:

To delete downloaded packages (.deb) already installed (and no longer needed)

sudo apt-get clean

To remove all stored archives in your cache for packages that can not be downloaded anymore (thus packages that are no longer in the repository or that have a newer version in the repository).

sudo apt-get autoclean

To remove unnecessary packages (After uninstalling an app there could be packages you don't need anymore)

sudo apt-get autoremove

To delete old kernel versions

sudo apt-get remove --purge linux-image-X.X.XX-XX-generic

If you don't know which kernel version to remove

dpkg --get-selections | grep linux-image

Solution 2:

You can open a terminal and run

df -h

This will show you how much space is left. The -h flag is to have human readable output.

If you have too little space there are two things you can do to find out what you could delete.

First,

sudo apt-get install ncdu
cd / 
ncdu

Ncdu has options to go through your files and see which folders are too large and which you can delete. Don't delete system files, though unless you know what you are doing. Focus on the home folder.

Second, you can find out whether you have duplicate files. If so you could spare some space here. For that purpose you can install fdupes,

sudo apt-get install fdupes
cd $HOME
fdupes -r . # use -d to get a delete promt