ubuntu18.04更换国内源
时间: 2023-03-26 12:01:17 浏览: 136
可以使用以下命令更换为国内源:
sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
然后更新源:
sudo apt-get update
注意:更换源可能会影响软件包的稳定性和安全性,请谨慎操作。
相关问题
Ubuntu mate 18.04 更换国内源
您可以通过以下步骤将Ubuntu MATE 18.04更换为国内源:
1. 打开终端,并以root用户身份执行以下命令:
```
sudo su
```
2. 执行以下命令备份原有的软件源列表:
```
cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
3. 执行以下命令编辑软件源列表:
```
nano /etc/apt/sources.list
```
4. 将文件中的所有内容替换为以下内容,表示使用阿里云的Ubuntu软件源:
```
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
```
5. 保存文件并退出编辑器。
6. 执行以下命令更新软件源信息:
```
apt-get update
```
现在,您的Ubuntu MATE 18.04已经更换为国内源了。
UBUNTU18.04换国内源
你可以使用以下命令将 Ubuntu 18.04 的软件源更换为国内源:
1.备份原有源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.编辑源列表
sudo gedit /etc/apt/sources.list
3.将原有的源地址替换为以下地址:
阿里云源:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
清华源:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
4.更新源列表
sudo apt-get update
注意:更换源之前最好备份原有源列表,以便出现问题时可以恢复。
阅读全文