How to find out the details of the used memory on the Raspberry Pi
We will first update and upgrade all the packages of the Raspberry Pi repository by using a command:
After making sure all the packages are up to date, we will install a package of “Baobob” that is used to find out the information about the occupied space on the Raspberry Pi:
After the successful installation of the “Baobab”, we will launch it using the command:
A graphical interface will be opened with the name of “Devices and Locations”:
In the above output we can see that the total free memory of the Raspberry Pi is 55.6 GB, we will click on the “raspberrypi” to extract the information about the memory:
In the above output we can see different directories are using the memory of the Raspberry pi, now we can see that the “usr” occupied the 3.4 GB space, so we will click on it and find out the files which are using space:
Like this, we can look into every directory and note down the files which are no longer used and can remove them from the Raspberry Pi to free up the space.
How to free up space on Raspberry Pi
We can free up the space by removing the packages from the Raspberry Pi which occupied maximum space and are of no use to us, for example, we want to remove the “VLC media player”, so we will use the following command:
Similarly when we install and delete the packages on the Raspberry Pi, the cache data is stored on the memory and a time comes when it takes a large space on the memory of the Raspberry Pi, in order to clean up the memory from the cache data, use the command:
Similarly, to remove the packages and dependencies of different packages which are not being used from a long time, use the command:
After running these commands, we will again launch the “Baobab” to confirm whether some memory has been free up or not, we will launch the “Baobab” application by using the command:
And we can see that we have free up about 100 MB space and the available space is updated from 55.6 GB to 55.7 GB:
Conclusion
By downloading different packages on the Raspberry Pi not only occupies the space of the Raspberry Pi but also reduces the efficiency of the CPU. When the Raspberry Pi is switched on, the processor of the CPU loads all the files and programs which makes it slow. In this write-up, we have discussed the methods to free up the space on the Raspberry Pi and also discuss the Baobab utility which is used to monitor the memory statistics of the Raspberry Pi.