V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Newyorkcity
V2EX  ›  问与答

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

  •  
  •   Newyorkcity · 2019-08-20 23:34:50 +08:00 · 6025 次点击
    这是一个创建于 1949 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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.
    
    9 条回复    2020-02-25 00:24:49 +08:00
    ipwx
        1
    ipwx  
       2019-08-20 23:44:59 +08:00   ❤️ 1
    要啥 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
        2
    DEANHZED  
       2019-08-21 00:15:01 +08:00
    s 不得要, "http".
    CEBBCAT
        3
    CEBBCAT  
       2019-08-21 06:22:18 +08:00 via Android
    错误报告给你安排得明明白白的,请你先 Try installing ca-certificates 好吗?


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

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

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

    谁是猪队友你再想想吧。
    CEBBCAT
        5
    CEBBCAT  
       2019-08-21 08:01:57 +08:00   ❤️ 1
    楼主你可以参考一下这个: 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
        6
    msg7086  
       2019-08-21 08:07:42 +08:00
    @CEBBCAT 一楼二楼已经说得明明白白了,切换到 http 源然后就能装上 ca-certificates 了。
    lonewolfakela
        7
    lonewolfakela  
       2019-08-21 12:58:57 +08:00
    事实上你需要的是先用 http 源,然后安装 apt-transport-https,这之后就可以改用 https 源了。
    出现这样的问题是因为 Debian 的 apt 默认没有 https 支持的原因
    llvm98
        8
    llvm98  
       2019-09-29 23:46:57 +08:00
    事实上 Debian Buster 开始你已经不需要再特意下载 apt-transport-https 了,这个问题的关键是没 ca-certificates,但修改 sources.list 文件后你又没办法下载这个包了,所以五楼说的是对的
    wktrf
        9
    wktrf  
       2020-02-25 00:24:49 +08:00
    emmm,才一百多天咋包都没了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1248 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:01 · PVG 02:01 · LAX 10:01 · JFK 13:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.