Last active
June 10, 2024 10:48
-
-
Save rdmarsh/5070295 to your computer and use it in GitHub Desktop.
Clean up the Raspbian default build for the Raspberry Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Remove unused packages on Raspberry Pi ## | |
| Warning: this will probably break something. If you need sound, don't remove the "alsa" packages | |
| sudo apt-get --yes purge xserver-common x11-xfs-utils x11-xserver-utils xinit libsmbclient blt gvfs gvfs-backends gvfs-daemons gvfs-fuse idle idle-python2.7 idle-python3.2 idle3 libaudio2 libice6 liblightdm-gobject-1-0 libobrender27 libpulse0 libqt4-svg libqtgui4 libsdl-image1.2 libsdl-mixer1.2 libsdl-ttf2.0-0 libsdl1.2debian libsm6 libsmpeg0 libwebkitgtk-1.0-0 libwebkitgtk-3.0-0 libxaw7 libxklavier16 libxmu6 libxss1 libxt6 libxtst6 lightdm lightdm-gtk-greeter lxde lxde-core midori nano obconf openbox python-pygame python-tk python3-tk scratch tk8.5 wpagui x11-common x11-utils x11-xkb-utils xinit xserver-common xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-video-fbdev zenity xserver* x11-common x11-utils x11-xkb-utils x11-xserver-utils xarchiver xauth xkb-data console-setup xinit lightdm libx{composite,cb,cursor,damage,dmcp,ext,font,ft,i,inerama,kbfile,klavier,mu,pm,randr,render,res,t,xf86}* lxde* lx{input,menu-data,panel,polkit,randr,session,session-edit,shortcut,task,terminal} obconf openbox gtk* libgtk* alsa* nano python-pygame python-tk python3-tk scratch tsconf desktop-file-utils cifs-utils samba-common smbclient4 | |
| ### 2013-02-09-wheezy-raspbian | |
| The above, plus (Warning, not really tested, may break stuff (eg my wireless broke after doing this)) | |
| sudo apt-get --yes purge cups-bsd cups-client fonts-droid fuse gettext-base ghostscript gnome-accessibility-themes gnome-themes-standard-data libasound2 libasprintf0c2 libasyncns0 libaudit0 libcaca0 libcupsimage2 libfile-copy-recursive-perl libflac8 libfm-data libfuse2 libgif4 libgs9 libgs9-common libid3tag0 libijs-0.35 libjbig2dec0 libjson0 libmad0 libmenu-cache1 libmikmod2 libmtdev1 libogg0 libopenjpeg2 libpaper-utils libpaper1 libpciaccess0 libpoppler19 libportmidi0 libqt4-network libqt4-xml libqtdbus4 libsamplerate0 libsndfile1 libutempter0 libvorbis0a libvorbisenc2 libvorbisfile3 libvte-common libwebp2 libwnck-common poppler-data python-numpy python-support tcl8.5 update-inetd xbitmaps zenity-common aspell aspell-en console-setup-linux cups-common dconf-gsettings-backend dconf-service dictionaries-common fontconfig fontconfig-config gconf2-common glib-networking glib-networking-common glib-networking-services gsettings-desktop-schemas gsfonts hicolor-icon-theme iso-codes libaspell15 libatk1.0-0 libatk1.0-data libavahi-client3 libavahi-common-data libavahi-common3 libavahi-glib1 libbluetooth3 libbluray1 libcdio-cdda1 libcdio-paranoia1 libcdio13 libck-connector0 libcolord1 libcups2 libdatrie1 libdconf0 libdrm2 libenchant1c2a libexif12 libfontconfig1 libfontenc1 libgconf-2-4 libgdk-pixbuf2.0-common libgdu0 libglapi-mesa libgnome-keyring-common libgnome-keyring0 libgphoto2-port0 libhunspell-1.3-0 libicu48 libjasper1 libjpeg8 liblcms1 liblcms2-2 libltdl7 libmng1 libnettle4 liborc-0.4-0 libpam-ck-connector libpixman-1-0 libpolkit-agent-1-0 libpolkit-backend-1-0 libproxy0 libqtcore4 libthai-data libthai0 libtiff4 netsurf-common sgml-base ttf-dejavu-core xml-core | |
| ### remove unneeded X directories | |
| `apt-get purge` might delete these for you: | |
| sudo rm -r /usr/lib/xorg/modules/linux /usr/lib/xorg/modules/extensions /usr/lib/xorg/modules /usr/lib/xorg | |
| ### Clean out any remaining stuff ### | |
| sudo apt-get --yes autoremove | |
| sudo apt-get --yes autoclean | |
| sudo apt-get --yes clean | |
| do an update/upgrade: | |
| sudo apt-get --yes update | |
| sudo apt-get --yes upgrade | |
| ## Change user ## | |
| Change the `pi` user to one better suited to you. Mount the SD card in another linux box: | |
| dmesg | tail | |
| sudo mount /dev/sdx2 /mnt/tmp | |
| and perform the following: | |
| sudo vi /mnt/tmp/etc/passwd | |
| sudo vi /mnt/tmp/etc/group | |
| sudo vi /mnt/tmp/etc/shadow | |
| sudo vi /mnt/tmp/etc/gshadow | |
| sudo vi /mnt/tmp/etc/sudoers | |
| sudo mv /mnt/tmp/home/pi /mnt/tmp/home/[username] | |
| ## Regen ssh keys## | |
| It's a good idea to regenerate the ssh keys rather than use the ones on the image. | |
| sudo rm /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server | |
| You may need to clear out the old keys in `.ssh/know_hosts` on the client: | |
| ssh-keygen -R [IP] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After all this, I still had bluetooth daemon running. Killed by purging
bluezpackage.