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://deb.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更新索引