Debian 11 改用阿里云源

By 大伟哥 | 2022-11-01,周二, 22:27

从 Debian 官网下载 Debian 11 的网络安装盘后,软件源列表里随便选了一个,进入界面后运行 apt update 发现速度比较慢而且会出错,还是换成习惯用的阿里云Debian 11的源好用。

修改/etc/apt/sources.list,加入下面的行:

deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

并把原来定义的源用#号注释掉,保存。

接下来运行 apt update 可能会报错: 

Could not handshake: Error in the certificate verification.

这是因为安全证书认证失败了,没法更新系统。这时候可以先把源网址的协议从https改成http,暂时不使用安全链接。然后安装ca-certificates

apt install ca-certificates

待ca-certificates安装完成后,再把源网址改回https,这样就可以正常使用 Debian 11 的阿里云源进行更新和升级了。

添加新评论

此字段内容将保密,不会被其他人看见。
  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
发布评论前,请通过下面的验证,以免被当作垃圾评论机器人屏蔽。
7 + 1 =
计算出这道简单的算术题并键入答案。例如、1+3,就输入 4。