PDF Print E-mail
Remove X or create a headless server on a Raspberry Pi


As I use my Raspberry Pi as a headless server, I thought it would be a good idea to clean up unnecessary files. After studying some material from others and several attempts later, I distilled the following steps...

Login to your Raspberry Pi, so open a terminal and use SSH...


1. To get rid of orphaned files later, we are going to install a program called deborphan first:
sudo apt-get install deborphan


2. Next we are going to remove all desktops from your Raspbian (if you don't want to remove samba, remove it from the following command!):
sudo apt-get remove --auto-remove --purge libx11-.* lxde-.* raspberrypi-artwork xkb-data omxplayer penguinspuzzle sgml-base xml-core cifs-.* samba-.* fonts-.* desktop-* gnome-.*


3. Now we are going to remove all orphaned files:
sudo apt-get remove --purge $(deborphan)


4. After that it is time to remove the unnecessary packages that are not orphaned:
sudo apt-get autoremove


5. You can even free up more space by removing the locales:
sudo apt-get install locale:purge:
sudo localepurge


6. Clean up som more:
sudo apt-get clean


7. You might need to reinstall the following packages for squeezelite:
sudo apt-get install -y libflac-dev libfaad2 libmad0


8. Reboot If you want, else stop start the service:
sudo shutdown -r now


By doing a before and an after, you can see the difference:
df -h /dev/root


Suggestions for improving this article are welcome, please let me know and This e-mail address is being protected from spambots. You need JavaScript enabled to view it .


Sponsored Links