更换Ubuntu 20.04镜像源

将Ubuntu 20.04的镜像源更换为阿里云,参考

Ubuntu 20.04的镜像源列表记录在/etc/apt/source.list文件中。

(1)首先将source.list复制为source.list.bak备份;

(2)然后将source.list内容改为需要的镜像源列表;

(3)修改完成后保存source.list文件,执行 sudo apt update。

本节均为 Ubuntu 20.04 的镜像源列表。若为其他版本,将所有focal更改为其他版本代号即可。

常用的Ubuntu版本代号如下:

  • Ubuntu 22.04:jammy
  • Ubuntu 20.04:focal
  • Ubuntu 18.04:bionic
  • Ubuntu 16.04:xenial
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ 
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 ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值