Ubuntu 20.04镜像源
时间: 2023-03-23 08:00:35 浏览: 1710
Ubuntu 20.04 镜像源包括官方源和第三方源,可以通过以下命令来查看和修改镜像源:
1. 查看当前镜像源:
```
cat /etc/apt/sources.list
```
2. 备份当前镜像源文件:
```
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
3. 修改为清华大学的镜像源:
```
sudo sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
```
执行完这个命令后,镜像源会被修改为清华大学的镜像源。
4. 更新软件包列表:
```
sudo apt update
```
执行这个命令后,Ubuntu 就会从新的镜像源中获取软件包列表。
注意:以上操作仅供参考,具体的镜像源地址和修改方法可能会因地区和时间而有所不同。
相关问题
ubuntu20.04镜像源
Ubuntu 20.04的镜像源可以通过以下步骤进行修改:
1. 打开终端
2. 输入命令:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
3. 输入命令:sudo gedit /etc/apt/sources.list
4. 在打开的文件中,将原来的内容注释掉(在每一行前面加上#),然后添加以下内容:
```
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
```
5. 保存文件并退出
6. 输入命令:sudo apt-get update
ubuntu20.04 镜像源
Ubuntu 20.04的镜像源可以通过以下步骤进行更换:
1. 打开终端,安装vim或者其他编辑器:sudo apt-get install vim。
2. 备份原来的镜像源文件:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak。
3. 打开镜像源文件:sudo vim /etc/apt/sources.list。
4. 将以下阿里镜像源的内容复制粘贴到文件中:
```
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
```
5. 保存并关闭文件。
6. 更新软件包列表:sudo apt-get update。
现在,您的Ubuntu 20.04的镜像源已经更换为阿里镜像源。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Ubuntu20.04更换镜像源](https://blog.csdn.net/Erictr/article/details/121729194)[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_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文