跳到主要内容

Ubuntu 系统使用阿里源

小林
后端开发工程师, 专注Go开发、微服务和云原生

备份原 sources.list 文件

cp /etc/apt/sources.list /etc/apt/sources.list.bak

使用阿里源

sed -i "s@http://.*archive.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \
sed -i "s@http://.*security.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list

更新系统

apt update && apt upgrade -y