这里有一台国内的云服务器重新部署Web环境,但是默认的是Debian官方源,安装软件的时候比较慢。这里我考虑将更换成国内镜像源。比如我们常用的源镜像包括腾讯云、阿里云、华为云登。这里我直接按照惯例将Debian的源更换。
修改配置:
/etc/apt/sources.list
我将里面的文件替换:
deb https://mirrors.cloud.tencent.com/debian/ buster main contrib non-free deb https://mirrors.cloud.tencent.com/debian/ buster-updates main contrib non-free deb https://mirrors.cloud.tencent.com/debian/ buster-backports main contrib non-free deb https://mirrors.cloud.tencent.com/debian-security buster/updates main contrib non-free deb-src https://mirrors.cloud.tencent.com/debian/ buster main contrib non-free deb-src https://mirrors.cloud.tencent.com/debian/ buster-updates main contrib non-free deb-src https://mirrors.cloud.tencent.com/debian/ buster-backports main contrib non-free deb-src https://mirrors.cloud.tencent.com/debian-security buster/updates main contrib non-free
替换完毕之后,执行命令。
apt update -y
不过在执行后有错误提示。
我开始以为是腾讯云源的问题,于是我更换成阿里云和华为云的Debian源也是如此。
华为云Debian源:
deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
阿里云Debian源:
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib deb http://mirrors.aliyun.com/debian-security buster/updates main deb-src http://mirrors.aliyun.com/debian-security buster/updates main deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
然后执行后依旧有问题。
E: The repository 'https://***/debian buster-backports Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
都会看到这个错误,看来问题是一样的,换源不能解决问题。
其实较多的问题都集中在buster-backports文件上,是不是这个源URL有问题,那我们将这个源更换成Debian源,其他不变是不是就可以解决。
将有"buster-backports main contrib non-free"的行的内容换成Debian源的。
deb http://archive.debian.org/debian buster-backports main contrib non-free deb-src http://archive.debian.org/debian buster-backports main contrib non-free
然后我们再执行 :
apt update && apt upgrade
问题是可以得到解决的。
评论