WSL 中使用 debian 有办法换 apt 源吗?

2019-08-20 23:34:50 +08:00
 Newyorkcity

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

按照清华镜像站的说明修改文件内容后

apt-get update 报错

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ca-certificates is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ca-certificates' has no installation candidate
root@DESKTOP-L79Q7C3:/home/syx# apt-get upate
E: Invalid operation upate
root@DESKTOP-L79Q7C3:/home/syx# apt-get update
Ign:1 https://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease
Ign:2 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease
Ign:3 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports InRelease
Ign:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease
Err:5 https://mirrors.tuna.tsinghua.edu.cn/debian buster Release
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Err:6 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates Release
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Err:7 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports Release
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Err:8 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates Release
  Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]
Reading package lists... Done
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster-updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster-backports/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/buster/updates/InRelease: No system certificates available. Try installing ca-certificates.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian buster 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.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster-updates/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates 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.
W: https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster-backports/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/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.
W: https://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/buster/updates/Release: No system certificates available. Try installing ca-certificates.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates 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.
5988 次点击
所在节点    问与答
9 条回复
ipwx
2019-08-20 23:44:59 +08:00
要啥 https。

sed -i 's!https://mirrors.tuna.tsinghua.edu.cn!http://mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
apt-get update
DEANHZED
2019-08-21 00:15:01 +08:00
s 不得要, "http".
CEBBCAT
2019-08-21 06:22:18 +08:00
错误报告给你安排得明明白白的,请你先 Try installing ca-certificates 好吗?


«提问的智慧»读一读,错误报告自己至少也要逐词读过吧?

错误报告都不读,Emmm,以后还怎么写 bug ?
---
说楼上是猪队友不过分吧?
msg7086
2019-08-21 07:12:25 +08:00
@CEBBCAT 只要花一分钟读一下帖子就能看到:

E: Package 'ca-certificates' has no installation candidate

谁是猪队友你再想想吧。
CEBBCAT
2019-08-21 08:01:57 +08:00
楼主你可以参考一下这个: https://askubuntu.com/questions/792354/ubuntu-docker-container-update-ca-certificates-command-not-found

我推荐你这样做:
1. 恢复 apt 配置到初始的情况
2. apt update
3. apt install ca-certificates
4. 现在你可以切换到 https 版本的 apt 配置了
---
@msg7086 #4

这题真的好难,你说得对,我终于推断出来楼主尝试安装过 ca-certificates 了

我是猪队友,好了吧?
msg7086
2019-08-21 08:07:42 +08:00
@CEBBCAT 一楼二楼已经说得明明白白了,切换到 http 源然后就能装上 ca-certificates 了。
lonewolfakela
2019-08-21 12:58:57 +08:00
事实上你需要的是先用 http 源,然后安装 apt-transport-https,这之后就可以改用 https 源了。
出现这样的问题是因为 Debian 的 apt 默认没有 https 支持的原因
llvm98
2019-09-29 23:46:57 +08:00
事实上 Debian Buster 开始你已经不需要再特意下载 apt-transport-https 了,这个问题的关键是没 ca-certificates,但修改 sources.list 文件后你又没办法下载这个包了,所以五楼说的是对的
wktrf
2020-02-25 00:24:49 +08:00
emmm,才一百多天咋包都没了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/593669

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX