ubuntu16.04一键换源
时间: 2023-09-11 07:05:28 浏览: 97
Ubuntu快速更换国内源
5星 · 资源好评率100%
你可以按照以下步骤在Ubuntu 16.04中一键换源:
1. 首先备份原来的源文件,以防止出现问题后可以恢复。你可以使用以下命令备份:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
2. 接下来,你可以使用命令行工具一键替换源。常用的一键换源工具是 `ustc` 和 `tuna`,你可以选择一个使用。以下是使用`ustc`源的步骤:
```
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
```
或者使用 `tuna` 源的步骤:
```
sudo sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
sudo sed -i 's/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
```
3. 更新源列表,以使更改生效:
```
sudo apt update
```
现在你的Ubuntu 16.04已经成功一键换源了。请记得在更改源之前备份源文件,以便在需要时可以恢复原来的设置。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Ubuntu16.04更换源](https://blog.csdn.net/madefromme/article/details/78640848)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Ubuntu 16.04 换源](https://blog.csdn.net/dugudaibo/article/details/82709002)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文