-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.rspi3.sh
executable file
·61 lines (49 loc) · 2.38 KB
/
bootstrap.rspi3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -e
# verified with clean raspberry-pi-os (debian 12)
# - https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit
# - https://www.raspberrypi.com/documentation/computers/os.html
# check os code name
if [ "$(lsb_release -sc)" != "bookworm" ]; then
echo "Debian 12 (Bookworm) is the only supported version"
exit 1
fi
# must be execute as default user
if [ $(id -u) -ne 1000 ]; then
echo "please run the script with default user \"pi (uid: 1000)\""
exit 1
fi
# system upgrade
sudo apt update
sudo apt upgrade -y
# better working environment
sudo apt install --no-install-recommends -y \
colordiff \
fonts-wqy-microhei \
fonts-wqy-zenhei \
git-extras \
jq \
ripgrep \
tig \
vim \
vlc
# remove unwanted default packages
sudo apt purge -y \
debian-reference-common \
debian-reference-en
# cleanup
sudo apt autoremove -y
# remove unwanted menu items
sudo rm -vf /usr/share/raspi-ui-overrides/applications/debian-reference-common.desktop
sudo rm -vf /usr/share/raspi-ui-overrides/applications/magpi.desktop
sudo rm -vf /usr/share/raspi-ui-overrides/applications/raspi_getstart.desktop
sudo rm -vf /usr/share/raspi-ui-overrides/applications/raspi_help.desktop
sudo rm -vf /usr/share/raspi-ui-overrides/applications/raspi_resources.desktop
# unhide useful menu items
sudo sed -i '/^NoDisplay/s/true/false/' /usr/share/raspi-ui-overrides/applications/htop.desktop
# cleanup default directories if not empty
rmdir -v ~/{Documents,Downloads,Music,Pictures,Public,Templates,Videos} 2>/dev/null || true
# locale setup
sudo debconf-set-selections <<< 'locales locales/default_environment_locale select en_US.UTF-8'
sudo dpkg-reconfigure --frontend=noninteractive locales
sudo update-locale