Removing Unneeded Packages From Raspbian
While tinkering with my Raspberry Pi, I wanted to deploy something streamlined. So I needed to remove all the packages that I have deemed unnecessary to obtain as close to a bare installation as possible.
Remove Extra Packages¶
- The exact command I used to remove the packages:
sudo apt-get remove --purge wolfram-engine penguinspuzzle scratch dillo squeak-vm squeak-plugins-scratch sonic-pi idle idle3 netsurf-gtk netsurf-common
- Next, run a little bit of housekeeping:
sudo apt-get autoremove sudo apt-get clean
- And then remove example files and optional files:
rm -rf /home/pi/python_games sudo rm -rf /opt/vc
NOTE: This will remove more than 500MB of space, and bring the installation down under 2GB. This regained space can be used for swap to increase the performance of the RPi.
Remove the Graphical Environment¶
- Since I do not really need LXDE or the X Server, I can remove them along with a few other graphical packages that can further reduce the raspbian footprint:
apt-get --purge gnome-* lxde* lightdm* xserver* desktop-* python* smbclient lxappearance lxinput lxmenu-data lxpanel lxpolkit lxrandr lxsession lxsession-edit lxshortcut lxtask lxterminal leafpad menu menu-xdg xpdf xkb-data xinit xfonts-utils xfonts-encodings xdg-utils xauth xarchiver x11-utils x11-common apt-get autoremove
NOTE: This will free up another 800MB