新系统环境安装文档

  1. NodeJS
  2. Golang
  3. Docker (Ubuntu, CentOS/Rocky)
  4. zsh
  5. direnv

NodeJS

直接安装

https://nodejs.org/en/download/

1
2
3
4
https://nodejs.org/dist/v18.12.1/node-v18.12.1-linux-x64.tar.xz
xz -d
tar xf
mv

nvm 安装

https://github.com/nvm-sh/nvm

1
2
3
4
5
curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash

nvm ls-remote
nvm install 18
nvm use 18

nvm ENV

1
2
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Golang

https://go.dev/dl/

1
2
3
https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
tar zxf
mv

Golang ENV

1
2
export GOPATH=/path/to/go
export GOBIN=$GOPATH/bin

Ubuntu Docker

https://docs.docker.com/engine/install/ubuntu/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sudo apt-get remove docker docker-engine docker.io containerd runc

sudo apt-get update
sudo apt-get install \
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.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo docker run hello-world

CentOS Docker

https://docs.docker.com/engine/install/centos/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

sudo systemctl start docker

sudo docker run hello-world

zsh & ohmyzsh

https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH

1
2
apt install zsh git
yum install zsh git

https://ohmyz.sh/#install

1
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

ohmyzsh ENV

1
2
#PROMPT="%n@%m%# "
PROMPT="%(?:%F{green}➜ :%F{red}➜ ) %n@%m%# %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)"

direnv

https://direnv.net/docs/hook.html

1
2
apt install direnv
curl -sfL https://direnv.net/install.sh | bash

direnv ENV

  • ~/.bashrc: eval "$(direnv hook bash)"
  • ~/.zshrc: eval "$(direnv hook zsh)"
Donate - Support to make this site better.
捐助 - 支持我让我做得更好.