Debian系统无法升级的一个原因

我用WSL安装了Debian 12 系统,无法升级,出现以下错误:

yong@DESKTOP-D1TMKU9:~$ sudo apt update
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm InRelease
Ign:2 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates InRelease
Ign:3 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports InRelease
Ign:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security InRelease
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm InRelease
Ign:2 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates InRelease
Ign:3 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports InRelease
Ign:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security InRelease
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm InRelease
Ign:2 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates InRelease
Ign:3 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports InRelease
Ign:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security InRelease
Err:1 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm InRelease
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Err:2 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates InRelease
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Err:3 https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports InRelease
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Err:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security InRelease
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Reading package lists... Done
Building dependency tree... Done
All packages are up to date.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/bookworm-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/bookworm-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/bookworm-security/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/bookworm-security/InRelease: No system certificates available. Try installing ca-certificates.
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-updates/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/debian/dists/bookworm-backports/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/bookworm-security/InRelease  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.

好像是认证出现问题,网上搜了一阵,也没有找到明确的解决方法。无意间扫到在清华源有这么一句话:

Debian Buster 以上版本默认支持 HTTPS 源。如果遇到无法拉取 HTTPS 源的情况,请先使用 HTTP 源并安装:

sudo apt install apt-transport-https ca-certificates

于是,打开 /etc/apt/sources.list  把 https 换成 http,再运行 sudo apt update 果然可以了,按照提示安装上述软件,果然可以使用了。

随后,再把 http 改为 https,再次更新,果然没有问题了。

posted @ 2023-10-15 09:32  立体风  阅读(520)  评论(0编辑  收藏  举报