Closed geerlingguy closed 9 years ago
I have an initial version ready to go (locally), but I'm considering breaking this entire aspect of the project out into a separate GitHub project, maybe named diet-raspbian
or something like that. That way I can use it more generically, and configure it in ways that help other projects.
I could include it as a submodule of this repo, perhaps.
So far here are the preliminary space saving results:
BEFORE:
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.2G 2.4G 4.5G 35% /
/dev/root 7.2G 2.4G 4.5G 35% /
$ free -m
52M used
AFTER:
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.2G 1.5G 5.4G 22% /
/dev/root 7.2G 1.5G 5.4G 22% /
$ free -m
51M used
I've added diet-raspbian as a submodule, so at this point I just need to keep it up to date from time to time, and I should be fine.
Since I'm going to be doing a lot of testing on this platform, I want to have a really stable and easy way to get things back into a pristine condition.
Currently, Raspbian's default image weighs in at a hefty 2.5G (once fully installed and updated) according to
df -h
, but I think I can trim that down considerably by removing cruft I don't need for a bunch of headless servers.I'd like to wrap up the process in an Ansible playbook, so I can rebuild this lightweight image (and allow others to do the same) as-needed. I might even be tempted to host a lightweight zipped .img file on http://files.midwesternmac.com/, but we'll see.
There are a few guides to the process, but nothing authoritative (or updated):
It looks like this would be the process:
/boot/config.txt
values (see one of my Pis for current defaults; this should be specific to Pi revision)/home/pi/python_games
/home/pi/Desktop
/usr/share/icons/gnome/icon-theme.cache
/opt/vc/src/hello_pi/hello_video/test.h264
$ sudo apt-get remove --purge wolfram-engine
$ sudo apt-get remove --purge desktop-base lightdm lxappearance lxde-common lxde-icon-theme lxinput lxpanel lxpolkit lxrandr lxsession-edit lxshortcut lxtask lxterminal
$ sudo apt-get remove --purge obconf openbox raspberrypi-artwork xarchiver xinit xserver-xorg xserver-xorg-video-fbdev x11-utils x11-common
$ sudo apt-get remove --purge esound-common freepats sonic-pi jackd2 omxplayer
$ sudo apt-get remove --purge dillo squeak-plugins-scratch netsurf-gtk netsurf-common epiphany-browser-data fonts-droid gsfonts ruby1.9.1
/usr/share
!).$ sudo apt-get autoremove
$ sudo apt-get clean
Helpful hints:
$ sudo dpkg --get-selections | grep deinstall
(question: does this actually list everything?).$ sudo find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $NF ": " $5 }'
$ sudo du -hsx * | sort -rh | head -10