-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnewUbuntu
More file actions
executable file
·194 lines (153 loc) · 4.79 KB
/
newUbuntu
File metadata and controls
executable file
·194 lines (153 loc) · 4.79 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/env bash
# Performs common setup steps on a new Installation.
toRemove=''
toInstall=''
flatpakInstalled=''
rustInstalled=''
sensorsInstalled=''
echoHugeHeader() {
echo
echo -e "==================== \033[32m\033[1m$1\033[m ==================== "
echo
}
# ---------- Remove ----------
removeApps() {
echoHugeHeader "Removing Apps"
sudo apt purge -y -f ${toRemove} && sudo apt -y -f --purge autoremove
}
removeSnaps() {
sudo snap remove $(snap list | awk '!/^Name|^core|^snapd/ {print $1}')
toRemove="${toRemove} snapd"
}
removeTracking() {
toRemove="${toRemove} activity-log-manager apport zeitgeist-datahub"
}
# ---------- Install ----------
installApps() {
echoHugeHeader "Installing Apps"
sudo apt update && sudo apt -y -f install ${toInstall}
}
installBrave() {
echoHugeHeader "Installing Brave"
curl -fsS https://dl.brave.com/install.sh | sh
}
installChromium() {
toInstall="${toInstall} chromium-browser"
}
installEnpass() {
echoHugeHeader "Preparing to Install Enpass"
echo -e "Types: deb\nURIs: https://apt.enpass.io/\nSuites: stable\nComponents: main\nSigned-By: /etc/apt/trusted.gpg.d/enpass.asc" | sudo tee /etc/apt/sources.list.d/enpass.sources
wget -qO- https://apt.enpass.io/keys/enpass-linux.key | sudo tee /etc/apt/trusted.gpg.d/enpass.asc
toInstall="${toInstall} enpass"
}
installDocker() {
echoHugeHeader "Preparing to Install Docker"
# Add Docker's official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
wget -qO- https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
toInstall="${toInstall} docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin"
}
installFlatpak() {
toInstall="${toInstall} flatpak"
flatpakInstalled='1'
}
installGimp() {
toInstall="${toInstall} gimp gimp-data-extras"
}
installJdk() {
toInstall="${toInstall} openjdk-21-jdk"
}
installJre() {
toInstall="${toInstall} openjdk-21-jre"
}
installKrita() {
toInstall="${toInstall} krita"
}
installNodejs() {
echoHugeHeader "Installing Node.js"
wget -qO- https://deb.nodesource.com/setup_24.x | sudo bash -
toInstall="${toInstall} nodejs"
}
installRust() {
rustInstalled='1'
}
installSensors() {
toInstall="${toInstall} lm-sensors"
sensorsInstalled='1'
}
installVlc() {
toInstall="${toInstall} vlc"
}
installVscode() {
echoHugeHeader "Preparing to Install VSCode"
echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections
wget -q -O vscode.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"
toInstall="${toInstall} ./vscode.deb"
}
# ---------- Main Thread ----------
echoHugeHeader "Checking Prereqs"
sudo apt update && sudo apt -y -f install git whiptail rsync figlet apt-transport-https curl ca-certificates
sudo pro config set apt_news=false
echoHugeHeader "Getting Scripts"
wget -qO- https://raw.githubusercontent.com/aensley/UbuntuScripts/main/sbin/updateScripts | bash -
## ----- Get Input -----
removeChoices=$(
whiptail --title "Select Software to Remove" --checklist "Select Software to Remove" 10 40 5 \
Snaps "Snaps" on \
Tracking "Tracking" on \
3>&1 1>&2 2>&3
)
installChoices=$(
whiptail --title "Select Software to Install" --checklist "Select Software to Install" 23 50 17 \
Brave "Brave Browser" on \
Chromium "Chromium" off \
Docker "Docker" off \
Enpass "Enpass" on \
Flatpak "Flatpak" off \
Gimp "GIMP" on \
Jdk "JDK 21 (LTS)" on \
Jre "JRE 21 (LTS)" off \
Krita "Krita" on \
Nodejs "Node.js 24" on \
Rust "Rust" on \
Sensors "Sensors" on \
Vlc "VLC" on \
Vscode "VS Code" on \
3>&1 1>&2 2>&3
)
## ----- Remove -----
for removeJob in ${removeChoices}; do
eval "remove${removeJob}"
done
removeApps
## ----- Upgrade -----
echoHugeHeader "Upgrading System"
sudo apt update && sudo apt -y -f -u full-upgrade && sudo apt autoremove --purge && sudo apt clean
## ----- Install -----
for installJob in ${installChoices}; do
eval "install${installJob}"
done
installApps
if [ -n "${flatpakInstalled}" ]; then
echoHugeHeader "Setting up Flathub Repo"
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
fi
if [ -n "${rustInstalled}" ]; then
echoHugeHeader "Installing Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
if [ -n "${sensorsInstalled}" ]; then
echoHugeHeader "Setting up Sensors"
sudo sensors-detect
sudo systemctl start kmod
fi