WSL 安装 Debian后,换源tsinghua.edu.cn 无法更新

清华源地址:

https://mirrors.tuna.tsinghua.edu.cn/help/debian/

 

换源后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: 198.18.1.110 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: 198.18.1.110 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: 198.18.1.110 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: 198.18.1.110 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: 198.18.1.110 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: 198.18.1.110 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: 198.18.1.110 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: 198.18.1.110 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.

 

 

 

 

来源CHATGPT:

 

2. Restore the Trusted Debian Mirror

Edit your sources:

bash
sudo nano /etc/apt/sources.list

Replace all https://mirrors.tuna.tsinghua.edu.cn with:

bash
deb http://deb.debian.org/debian bookworm main contrib non-free deb http://security.debian.org/debian-security bookworm-security main contrib non-free deb http://deb.debian.org/debian bookworm-updates main contrib non-free

Save and exit.


✅ 3. Fix Missing Certificates

You're missing the ca-certificates package, so HTTPS fails. Fix it manually:

    1. Get the .deb from a working system or from a browser:

      URL:
      https://deb.debian.org/debian/pool/main/c/ca-certificates/ca-certificates_20230311_all.deb

    2. Transfer it to your broken system, then install:

      bash
      sudo dpkg -i ca-certificates_20230311_all.deb sudo update-ca-certificates

 

 

然后再换回清华的源,问题就解决了。

 

posted @ 2025-08-01 21:51  profesor  阅读(139)  评论(0)    收藏  举报