-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux.sh
322 lines (210 loc) · 6.01 KB
/
linux.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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
#!/bin/bash
# Update and Upgrade
echo "Update and Upgrade"
sudo apt update
sudo apt upgrade -y
sudo apt autoremove
sudo apt autoclean
# Install Wget
if [ -x "$(command -v wget)" ]
then
echo "Wget is already installed"
else
echo "Installing Wget"
sudo apt update
sudo apt install wget
fi
# Install curl
if [ -x "$(command -v curl)" ]
then
echo "Curl is already installed"
else
echo "Installing Curl"
sudo apt update
sudo apt install curl
fi
# Install Git
if [ -x "$(command -v git)" ]
then
echo "Git is already installed"
else
echo "Installing Git"
sudo apt update
sudo apt install git
fi
# Install snap
if [ -x "$(command -v snap)" ]
then
echo "Snap is already installed"
else
echo "Installing Snap"
sudo apt update
sudo apt install snapd
fi
# Install Visual Studio Code
if [ -x "$(command -v code)" ]
then
echo "Visual Studio Code is already installed"
else
echo "Installing Visual Studio Code"
sudo snap install code --classic
fi
# Install Google Chrome
if [ -x "$(command -v google-chrome)" ]
then
echo "Google Chrome is already installed"
else
echo "Installing Google Chrome"
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt update
sudo apt install google-chrome-stable
fi
# Install Node.js
if [ -x "$(command -v node)" ]
then
echo "Node.js is already installed"
else
echo "Installing Node.js"
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v
fi
# Install Pnpm
if [ -x "$(command -v pnpm)" ]
then
echo "Pnpm is already installed"
else
echo "Installing Pnpm"
curl -fsSL https://get.pnpm.io/install.sh | sh -
pnpm -v
echo "Add Pnpm to PATH"
# Add pnpm store to PATH
echo 'export PATH="$PATH:~/.local/share/pnpm"' >> ~/.bashrc
# export PATH="$PATH:~/.local/share/pnpm"
echo 'export PATH="$PNPM_HOME:$PATH"' >> ~/.bashrc
fi
# Install Htop
if [ -x "$(command -v htop)" ]
then
echo "Htop is already installed"
else
echo "Installing Htop"
sudo apt update
sudo snap install htop
fi
# Android Studio
if [ -x "$(command -v android-studio)" ]
then
echo "Android Studio is already installed"
else
echo "Installing Android Studio"
sudo snap install android-studio --classic
echo "Add Android Studio to PATH"
# Add Android Studio to PATH
echo 'export ANDROID_HOME=$HOME/Android/Sdk' >> ~/.bashrc
echo 'export ANDROID_SDK_ROOT=$HOME/Android/Sdk' >> ~/.bashrc
echo 'export PATH=$PATH:$ANDROID_HOME/emulator' >> ~/.bashrc
echo 'export PATH=$PATH:$ANDROID_HOME/tools' >> ~/.bashrc
echo 'export PATH=$PATH:$ANDROID_HOME/tools/bin' >> ~/.bashrc
echo 'export PATH=$PATH:$ANDROID_HOME/platform-tools' >> ~/.bashrc
echo 'export ANDROID_USER_HOME=$HOME/.android' >> ~/.bashrc
echo 'export ANDROID_EMULATOR_HOME=$HOME/.android' >> ~/.bashrc
echo 'export ANDROID_AVD_HOME=$HOME/.android/avd' >> ~/.bashrc
fi
# Install Starship
if [ -x "$(command -v starship)" ]
then
echo "Starship is already installed"
else
echo "Installing Starship"
sudo snap install starship
# Add Starship to PATH
echo "Add Starship to PATH"
echo 'eval "$(starship init bash)"' >> ~/.bashrc
fi
# Install Beekeeper Studio
if [ -x "$(command -v beekeeper-studio)" ]
then
echo "Beekeeper Studio is already installed"
else
echo "Installing Beekeeper Studio"
sudo snap install beekeeper-studio
fi
# Install Bun
if [ -x "$(command -v bun)" ]
then
echo "Bun is already installed"
else
echo "Installing Bun"
curl -fsSL https://bun.sh/install | bash
fi
# Brew
if [ -x "$(command -v brew)" ]
then
echo "Brew is already installed"
else
echo "Installing Brew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add Brew to PATH
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
fi
# Ruby
if [ -x "$(command -v ruby)" ]
then
echo "Ruby is already installed"
else
echo "Installing Ruby"
brew install rbenv ruby-build
# Add Ruby to PATH
echo 'eval "$(rbenv init - bash)"' >> ~/.bashrc
fi
# Fastlane
if [ -x "$(command -v fastlane)" ]
then
echo "Fastlane is already installed"
else
echo "Installing Fastlane"
brew install fastlane
fi
# Install Docker Desktop
if [ -x "$(command -v docker)" ]
then
echo "Docker Desktop is already installed"
else
# KVM/QEMU
sudo apt-get update
sudo apt-get install -y \
bridge-utils \
cpu-checker \
libvirt-clients \
libvirt-daemon \
qemu qemu-kvm \
virt-manager
sudo kvm-ok
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.lis
echo "Installing Docker Desktop"
curl -fsSL -o /tmp/docker-desktop-amd64.deb https://desktop.docker.com/linux/main/amd64/docker-desktop-4.16.2-amd64.deb
sudo apt-get install -y /tmp/docker-desktop-amd64.deb
rm -f /tmp/docker-desktop-amd64.deb
sudo apt-get update
# Validate current $USER is enabled for docker group
if ! (groups | grep docke); then
echo "Add $USER to docker group by running the following:"
echo "----"
echo ""
echo "sudo usermod -aG docker $USER"
echo "newgrp docker"
fi
fi