Skip to content

Instantly share code, notes, and snippets.

@rdmarsh
Last active June 10, 2024 10:48
Show Gist options
  • Select an option

  • Save rdmarsh/5070295 to your computer and use it in GitHub Desktop.

Select an option

Save rdmarsh/5070295 to your computer and use it in GitHub Desktop.
Clean up the Raspbian default build for the Raspberry Pi

Remove unused packages on Raspberry Pi

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

sudo rm -r /usr/lib/xorg/modules/linux /usr/lib/xorg/modules/extensions /usr/lib/xorg/modules /usr/lib/xorg

sudo apt-get --yes autoremove
sudo apt-get --yes autoclean
sudo apt-get --yes clean

localepurge

Change user

A simple way to change the default pi user. Mount the SD card and perform the following:

Change the pi user to one better suited to you.

vi /etc/passwd
vi /etc/group
vi /etc/shadow
vi /etc/gshadow

sudo mv home/pi home/[username]

Regen ssh keys##

It's a good idea to regenerate the ssh keys rather than use the ones on the image.

rm /etc/ssh/ssh_host_* && dpkg-reconfigure openssh-server
@Eyjafjallajokull
Copy link
Copy Markdown

After all this, I still had bluetooth daemon running. Killed by purging bluez package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment