将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.aliyu