-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubuntu.sh
executable file
·72 lines (62 loc) · 2.42 KB
/
ubuntu.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
#!/usr/bin/env bash
cd /tmp/ || exit
# Set up keyring and repository for eza
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
apt-get update
apt-get upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get -y install \
autoconf \
bat \
btop \
build-essential \
cmake \
cppcheck \
curl \
eza \
git \
libtool \
openssh-server \
pkg-config \
python3-pip \
python3-venv \
python3-pandas \
python3-matplotlib \
pipx \
net-tools \
ripgrep \
sqlite3 \
sqlite3-doc \
tmux \
unzip \
zip \
zsh
# For nvim appimage, only support ubuntu >= 22.04
# https://github.com/AppImage/AppImageKit/wiki/FUSE
sudo add-apt-repository universe
sudo apt install libfuse2
echo "=============================== Install latest nodejs ==============================="
# NODE_VERSION=19.x
NODE_VERSION=lts.x
curl -fsSL https://deb.nodesource.com/setup_$NODE_VERSION | sudo -E bash - && sudo apt-get install -y nodejs
# didn't find a way to grep the latest golang version
GO_VERSION=1.20
echo "=============================== Install golang ${GO_VERSION} ==============================="
rm -rf /usr/bin/go /usr/lib/go /usr/local/go /usr/share/go
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
ln -sf /usr/local/go/bin/go /usr/bin/go
ln -sf /usr/local/go/bin/gofmt /usr/bin/gofmt
echo "=============================== Install latest neovim ==============================="
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod +x nvim.appimage
mv nvim.appimage /etc/alternatives/nvim.appimage
ln -sf /etc/alternatives/nvim.appimage /usr/bin/vi
ln -sf /etc/alternatives/nvim.appimage /usr/bin/nvim
echo "=============================== Install latest lazygit ==============================="
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin