-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup_blockchain_ubuntu_onprem.sh
72 lines (52 loc) · 1.88 KB
/
setup_blockchain_ubuntu_onprem.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
#!/bin/bash
printf "\n[[[[[ setup_blockchain_ubuntu_onprem.sh ]]]]]\n\n"
# needed for on-premise nvidia machines
# Get node login password
printf "Enter node login password: "
read -s NODE_LOGIN_PW
printf "\n\n"
# do sudo once with a dummy command
echo $NODE_LOGIN_PW | sudo -S ls -la
printf '\n[[ Upgrading apt.. ]]\n'
sudo apt update
# skip prompting (see https://serverfault.com/questions/527789/how-to-automate-changed-config-files-during-apt-get-upgrade-in-ubuntu-12)
sudo apt-get --yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# needed for on-premise nvidia machines
printf '\n[ apt --fix-broken install ]\n'
sudo apt -y --fix-broken install
printf '\n[[ Uninstalling NodeJS.. ]]\n'
sudo apt-get -y purge nodejs
sudo apt-get -y autoremove
printf '\n[[ Installing NodeJS.. ]]\n'
sudo apt update
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# skip prompting for daemon restart (see https://askubuntu.com/questions/1367139/apt-get-upgrade-auto-restart-services)
sudo NEEDRESTART_MODE=a apt -y install nodejs
printf 'node -v\n'
node -v
printf 'npm --version\n'
npm --version
printf '\n[[ Installing yarn.. ]]\n'
sudo npm install -g yarn
printf 'yarn --version\n'
sudo yarn --version
printf '\n[[ Installing make.. ]]\n'
sudo apt update
# skip prompting for daemon restart (see https://askubuntu.com/questions/1367139/apt-get-upgrade-auto-restart-services)
sudo NEEDRESTART_MODE=a apt-get install -y build-essential
printf 'make --version\n'
make --version
printf '\n[[ Installing vim.. ]]\n'
sudo apt update
sudo apt install -y vim
printf 'vim --version\n'
vim --version
printf '\n[[ Installing jq.. ]]\n'
sudo apt update
sudo apt install -y jq
printf 'jq --version\n'
jq --version
printf '\n[[ Installing killall.. ]]\n'
sudo apt update
sudo apt install -y psmisc