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…

Step – 1: To get rid of orphaned files later, we are going to install a program called deborphan first:

sudo apt-get install deborphan

 

Step – 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-.*

 

Step – 3: Now we are going to remove all orphaned files:

sudo apt-get remove –purge $(deborphan)

 

Step – 4: After that it is time to remove the unnecessary packages that are not orphaned:

sudo apt-get autoremove

 

Step – 5: You can even free up more space by removing the locales:

sudo apt-get install locale:purge:
sudo localepurge

 

Step – 6: Clean up some more:

sudo apt-get clean

 

Step – 7: You might need to reinstall the following packages for squeezelite:

sudo apt-get install -y libflac-dev libfaad2 libmad0

 

Step – 8: Reboot If you want, else stop start the service:

sudo shutdown -r now

 

By doing a “before and after“, you can see the difference:

df -h /dev/root

 

Suggestions for improving this article are welcome, please let me know and drop me a line .

Updating Squeezelite on your Raspberry Pi

After running Squeezelite on my Raspberry Pi for a while, I thought it would be time to update Squeezelite to it’s latest version. And this is how I did it…

First you’ll have to login to your Raspberry Pi, you might want to open a terminal and use SSH…

If you don’t have a squeezelite folder, then create one! You can do this by using mkdir in your terminal:

mkdir squeezelite

 

Now go to your squeezelite folder:

cd squeezelite

 

Remove an older version, if it’s there:

rm ./squeezelite-armv6hf

 

Next download the latest version:

wget http://squeezelite-downloads.googlecode.com/git/squeezelite-armv6hf

 

Remove the old version:

sudo rm /usr/bin/squeezelite-armv6hf

 

Copy the latest version to the folder /usr/bin:

sudo cp squeezelite-armv6hf /usr/bin

 

Setting the permissions right:

sudo chmod a+x /usr/bin/squeezelite-armv6hf

 

Reboot If you want, else stop start the service:

sudo shutdown -r now

 

Now you are ready to rock and roll (again) !!!

 

Suggestions for improving this article are welcome, please let me know and drop me a line .