跳到主要内容
版本:Next

Ubuntu

准备工作(必看)

为保证镜像源稳定解析,请在配置前确保hosts文件以及配置正确的域名解析,如若未添加,请在/etc/hosts文件内添加以下内容后再进行镜像源配置

cat >> /etc/hosts << EOF 
10.251.102.1 mirrors.shanhe.com
EOF

Ubuntu

Ubuntu使用帮助
Ubuntu的仓库地址为:https://mirrors.shanhe.com/ubuntu/
Ubuntu-CD的镜像地址为:https://mirrors.shanhe.com/ubuntu-cdimage/
Ubuntu-Cloud的镜像地址为:https://mirrors.shanhe.com/ubuntu-cloud-images/
Ubuntu-Ports的仓库地址为:https://mirrors.shanhe.com/ubuntu-ports/
Ubuntu-Releases的镜像地址为:https://mirrors.shanhe.com/ubuntu-releases/
ubuntu-cloud-archive的镜像地址为:https://mirrors.shanhe.com/ubuntu-cloud-archive/

备份配置文件

执行如下命令:

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

修改sources.list文件

http://archive.ubuntu.comhttp://security.ubuntu.com替换成https://mirrors.shanhe.com,可以参考如下命令:

sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.shanhe.com@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.shanhe.com@g" /etc/apt/sources.list

更新索引

执行如下命令:

apt-get update