1、备份配置文件:
cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
2、修改sources.list文件,将http://ftp.debian.org替换成https://repo.huaweicloud.com,同时也将http://security.debian.org替换成https://repo.huaweicloud.com,可以参考如下命令:
点击查看代码
sed -i "s@http://ftp.debian.org@https://repo.huaweicloud.com@g" /etc/apt/sources.list
sed -i "s@http://security.debian.org@https://repo.huaweicloud.com@g" /etc/apt/sources.list
3、执行apt-get install apt-transport-https ca-certificates
安装https源,之后再执行apt-get update
更新索引
https://repo.huaweicloud.com/debian-cd/