Linux 远程开发环境配置

安装 git unzip

apt update
apt install -y git unzip

安装 oh-my-bash

bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"

nodejs 安装

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

nvm 代理

执行以下其中一项即可

# 临时生效
export NVM_NODEJS_ORG_MIRROR=http://mirrors.aliyun.com/nodejs-release
# 写入文件,长期生效
echo 'export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release' >> /root/.bashrc
# 阿里云内网使用
export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release
# 阿里云内网使用
echo 'export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release' >> /root/.bashrc
nvm install 14.21.3
nvm install lts

npm 代理

npm config set registry https://registry.npmmirror.com

docker 安装

export DOWNLOAD_URL="http://mirrors.aliyun.com/docker-ce/"
curl -fsSL https://get.docker.com/ | sudo -E sh
# 阿里云内网使用
export DOWNLOAD_URL="http://mirrors.cloud.aliyuncs.com/docker-ce/"
curl -fsSL https://get.docker.com/ | sudo -E sh

设置hosts

echo "8.217.88.233 mirrors.ubuntu.com" >> /etc/hosts
echo "8.217.88.233 archive.ubuntu.com">> /etc/hosts
echo "8.217.88.233 security.ubuntu.com">> /etc/hosts
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9