ubuntu切换阿里云

纲要

  • 备份原来的源
  • 检查源是否还存在
  • 覆盖
  • 更新

备份原来的源

sudo cp -ra /etc/apt/sources.list /etc/apt/sources.list.bak

检查源是否还存在

http://mirrors.aliyun.com/ubuntu/dists/

png

覆盖

将文件/etc/apt/sources.list里直接覆盖一下内容:

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 apt-get update
sudo apt-get upgrade