Skip to content

Instantly share code, notes, and snippets.

@hub23
Forked from samatjain/Slim-Raspbian.sh
Last active November 22, 2017 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hub23/59e636c1778aec9a22e72741da4ca30f to your computer and use it in GitHub Desktop.
Save hub23/59e636c1778aec9a22e72741da4ca30f to your computer and use it in GitHub Desktop.
Shrink Raspbian Installation
#!/bin/bash
date
df -h
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
epiphany-browser
lxde lxtask menu-xdg gksu
xserver-xorg-video-fbturbo
xpdf gtk2-engines alsa-utils
netsurf-gtk zenity
desktop-base lxpolkit
weston
omxplayer
raspberrypi-artwork
raspberrypi-ui-mods
lightdm gnome-themes-standard-data gnome-icon-theme
qt50-snapshot qt50-quick-particle-examples
"
# Edu-related packages
pkgs="$pkgs
bluej
greenfoot
idle python3-pygame python-pygame python-tk
idle3 python3-tk
python3-rpi.gpio
python-serial python3-serial
python-picamera python3-picamera
python3-pygame python-pygame python-tk
python3-tk
debian-reference-en dillo x2x
scratch nuscratch
timidity
smartsim penguinspuzzle
pistore
sonic-pi
python3-numpy
python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio
oracle-java8-jdk
minecraft-pi python-minecraftpi
wolfram-engine
"
# List removal candidates
echo "Packages to remove:"
echo $pkgs
# Remove packages
echo "Remove packages"
apt-get update
for i in $pkgs; do
apt-get -y remove --purge $i
done
# Remove all packages marked rc (thanks @symm)
echo "Remove all packages marked rc"
dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs dpkg --purge
# Remove Python Games
echo "Remove Python Games"
sudo rm -rf /home/pi/python_games
# Remove automatically installed dependency packages
echo "Remove automatically installed dependency packages"
apt-get -y autoremove
apt-get -y autoclean
date
df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment