ubuntu22.04 切换软件源到阿里云
时间: 2023-11-06 10:05:04 浏览: 144
你可以按照以下步骤将 Ubuntu 22.04 的软件源切换到阿里云:
1. 打开终端,输入以下命令备份原始的软件源列表:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 编辑软件源列表文件,使用以下命令打开 sources.list 文件:
```
sudo vim /etc/apt/sources.list
```
3. 全选原始文件内容并删除,然后将以下内容复制到文件中:
```
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.aliyun.com/ubuntu/ hirsute main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ hirsute main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ hirsute-updates main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ hirsute-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ hirsute-backports main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ hirsute-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ hirsute-security main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ hirsute-security main restricted universe multiverse
```
4. 保存并退出文件,然后运行以下命令更新软件源:
```
sudo apt update
```
现在你的 Ubuntu 22.04 就已经切换到阿里云的软件源了,你可以使用 apt 命令来安装更新软件了。
阅读全文