修改Ubuntu 软件源
更换国内镜像源可以使 Ubuntu 的第三方软件包的下载速度大步提升,这里以更换为阿里源为例:
-
阿里云官方镜像源地址:https://developer.aliyun.com/mirror/
-
点击 进入Ubuntu ,里面有各个版本的详细说明
- 我这里以20.20版本为例,复制源内容
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
- 执行如下命令
# 先备份系统原有的软件源配置
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 将复制的阿里源粘贴到新建的 sources.list 中
# 如果没有安装vim,使用系统自带的词也可
sudo vim /etc/apt/sources.list
- 替换文件内容
- 更新软件源以及更新软件
sudo apt-get update && apt-get upgrade
经过漫长的等待(看网速),若出现获取阿里源的链接地址,则表示软件源配置成功