更换ubuntu22.04LTS更换国内源
时间: 2023-09-12 08:08:57 浏览: 189
更换Ubuntu 22.04 LTS的国内源可以按照以下步骤进行:
1.备份当前的源列表
```shell
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2.编辑`/etc/apt/sources.list`文件
```shell
sudo nano /etc/apt/sources.list
```
3.将原文件中的内容注释掉(在每一行前面添加#号),然后将以下内容添加到文件末尾:
```shell
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.保存文件并退出编辑器。
5.更新软件包列表
```shell
sudo apt-get update
```
现在,你就可以使用国内源更新Ubuntu系统了。
阅读全文
相关推荐
![sh](https://img-home.csdnimg.cn/images/20250102104920.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)