Blame
|
1 | # Linux 远程开发环境配置 |
||||||
|
2 | |||||||
| 3 | ::: info |
|||||||
| 4 | 为了利用阿里内网加速,下面用到了内网域名,公网无法使用 |
|||||||
| 5 | 如在公网使用,请将 http://mirrors.cloud.aliyuncs.com 替换成 https://mirrors.aliyun.com |
|||||||
| 6 | ::: |
|||||||
| 7 | ||||||||
|
8 | ## 安装 git unzip |
||||||
|
9 | |||||||
| 10 | ```sh |
|||||||
|
11 | apt update |
||||||
| 12 | apt install -y git unzip |
|||||||
|
13 | ``` |
||||||
| 14 | ||||||||
|
15 | ## 安装 oh-my-bash |
||||||
|
16 | |||||||
| 17 | ```sh |
|||||||
|
18 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" |
||||||
|
19 | ``` |
||||||
| 20 | ||||||||
| 21 | ## nodejs 安装 |
|||||||
| 22 | ||||||||
| 23 | ```sh |
|||||||
| 24 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash |
|||||||
| 25 | ``` |
|||||||
| 26 | ||||||||
|
27 | ### nvm 代理 |
||||||
| 28 | ||||||||
| 29 | > 执行以下其中一项即可 |
|||||||
|
30 | |||||||
| 31 | ```sh |
|||||||
|
32 | # 临时生效 |
||||||
| 33 | export NVM_NODEJS_ORG_MIRROR=http://mirrors.aliyun.com/nodejs-release |
|||||||
|
34 | ``` |
||||||
| 35 | ||||||||
|
36 | ```sh |
||||||
|
37 | # 写入文件,长期生效 |
||||||
|
38 | echo 'export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release' >> /root/.bashrc |
||||||
| 39 | ``` |
|||||||
| 40 | ||||||||
|
41 | ```sh |
||||||
| 42 | # 阿里云内网使用 |
|||||||
| 43 | export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release |
|||||||
| 44 | ``` |
|||||||
| 45 | ||||||||
| 46 | ```sh |
|||||||
| 47 | # 阿里云内网使用 |
|||||||
| 48 | echo 'export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release' >> /root/.bashrc |
|||||||
|
49 | ``` |
||||||
|
50 | |||||||
| 51 | ```sh |
|||||||
|
52 | nvm install 14.21.3 |
||||||
| 53 | ``` |
|||||||
| 54 | ||||||||
|
55 | ```sh |
||||||
| 56 | nvm install lts |
|||||||
| 57 | ``` |
|||||||
| 58 | ||||||||
|
59 | ### npm 代理 |
||||||
| 60 | ||||||||
| 61 | ```sh |
|||||||
| 62 | npm config set registry https://registry.npmmirror.com |
|||||||
| 63 | ``` |
|||||||
| 64 | ||||||||
| 65 | ## docker 安装 |
|||||||
| 66 | ||||||||
| 67 | ```sh |
|||||||
|
68 | export DOWNLOAD_URL="http://mirrors.aliyun.com/docker-ce" |
||||||
|
69 | curl -fsSL https://get.docker.com/ | sudo -E sh |
||||||
| 70 | ``` |
|||||||
| 71 | ||||||||
| 72 | ```sh |
|||||||
| 73 | # 阿里云内网使用 |
|||||||
|
74 | export DOWNLOAD_URL="http://mirrors.cloud.aliyuncs.com/docker-ce" |
||||||
|
75 | curl -fsSL https://get.docker.com/ | sudo -E sh |
||||||
| 76 | ``` |
|||||||
|
77 | |||||||
| 78 | ## 设置hosts |
|||||||
| 79 | ||||||||
| 80 | ::: danger |
|||||||
| 81 | 谨慎使用 |
|||||||
| 82 | ::: |
|||||||
| 83 | ||||||||
| 84 | ```sh |
|||||||
| 85 | echo "8.217.88.233 mirrors.ubuntu.com" >> /etc/hosts |
|||||||
| 86 | echo "8.217.88.233 archive.ubuntu.com">> /etc/hosts |
|||||||
| 87 | echo "8.217.88.233 security.ubuntu.com">> /etc/hosts |
|||||||
| 88 | ``` |
|||||||