Blame

b2cfbd Qwas 2024-05-03 11:41:58 1
# Linux 远程开发环境配置
4ac20c Qwas 2024-04-28 17:09:43 2
3
::: info
4
为了利用阿里内网加速,下面用到了内网域名,公网无法使用
5
如在公网使用,请将 http://mirrors.cloud.aliyuncs.com 替换成 https://mirrors.aliyun.com
6
:::
7
fe9b28 Qwas 2024-05-03 13:12:09 8
## 安装 git unzip
1aa059 Qwas 2024-05-03 13:06:45 9
10
```sh
fe9b28 Qwas 2024-05-03 13:12:09 11
apt update
12
apt install -y git unzip
1aa059 Qwas 2024-05-03 13:06:45 13
```
14
fe9b28 Qwas 2024-05-03 13:12:09 15
## 安装 oh-my-bash
4ac20c Qwas 2024-04-28 17:09:43 16
17
```sh
fe9b28 Qwas 2024-05-03 13:12:09 18
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
4ac20c Qwas 2024-04-28 17:09:43 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
6bd0dc Qwas 2024-10-30 14:39:14 27
### nvm 代理
28
29
> 执行以下其中一项即可
4ac20c Qwas 2024-04-28 17:09:43 30
31
```sh
6bd0dc Qwas 2024-10-30 14:39:14 32
# 临时生效
33
export NVM_NODEJS_ORG_MIRROR=http://mirrors.aliyun.com/nodejs-release
4ac20c Qwas 2024-04-28 17:09:43 34
```
35
00544e Qwas 2024-04-29 12:08:54 36
```sh
6bd0dc Qwas 2024-10-30 14:39:14 37
# 写入文件,长期生效
00544e Qwas 2024-04-29 12:08:54 38
echo 'export NVM_NODEJS_ORG_MIRROR=http://mirrors.cloud.aliyuncs.com/nodejs-release' >> /root/.bashrc
39
```
40
6bd0dc Qwas 2024-10-30 14:39:14 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
00544e Qwas 2024-04-29 12:08:54 49
```
6bd0dc Qwas 2024-10-30 14:39:14 50
51
```sh
00544e Qwas 2024-04-29 12:08:54 52
nvm install 14.21.3
53
```
54
6bd0dc Qwas 2024-10-30 14:39:14 55
```sh
56
nvm install lts
57
```
58
4ac20c Qwas 2024-04-28 17:09:43 59
### npm 代理
60
61
```sh
62
npm config set registry https://registry.npmmirror.com
63
```
64
65
## docker 安装
66
67
```sh
5262f5 Qwas 2024-11-01 07:07:03 68
export DOWNLOAD_URL="http://mirrors.aliyun.com/docker-ce"
6bd0dc Qwas 2024-10-30 14:39:14 69
curl -fsSL https://get.docker.com/ | sudo -E sh
70
```
71
72
```sh
73
# 阿里云内网使用
5262f5 Qwas 2024-11-01 07:07:03 74
export DOWNLOAD_URL="http://mirrors.cloud.aliyuncs.com/docker-ce"
4ac20c Qwas 2024-04-28 17:09:43 75
curl -fsSL https://get.docker.com/ | sudo -E sh
76
```
6bd0dc Qwas 2024-10-30 14:39:14 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
```