【问题标题】:When running apt-get update prior to sbt install, a HTTP 403 is received在 sbt install 之前运行 apt-get update 时,收到 HTTP 403
【发布时间】:2017-06-30 13:41:33
【问题描述】:

  • 我正在尝试使用以下说明安装 SBT(来自 http://www.scala-sbt.org/0.13/docs/Installing-sbt-on-Linux.html
    echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
    sudo apt-get update
    sudo apt-get install sbt
    

  • 执行 apt-get update 时,收到 403:
    # sudo apt-get update
    ...
    Ign https://dl.bintray.com  InRelease
    Ign https://dl.bintray.com  Release.gpg
    Ign https://dl.bintray.com  Release
    Err https://dl.bintray.com  Packages
    Received HTTP code 403 from proxy after CONNECT
    ...
    W: Failed to fetch https://dl.bintray.com/sbt/debian/Packages  Received HTTP code 403 from proxy after CONNECT
    
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    

  • 检查密钥服务器(https://keyserver.ubuntu.com,搜索“sbt build tool”)未显示证书的到期日期:
    pub  4096R/642AC823 2015-05-29            
         Fingerprint=2EE0 EA64 E40A 89B8 4B2D  F734 99E8 2A75 642A C823 
    
    uid sbt build tool <scalasbt@gmail.com>
    sig  sig3  642AC823 2015-05-29 __________ __________ [selfsig]
    
    sub  4096R/06F9BF46 2015-05-29            
    sig sbind  642AC823 2015-05-29 __________ __________ []
    
    https://keyserver.ubuntu.com/pks/lookup?op=vindex&search=sbt+build&fingerprint=on
    

  • 我的操作系统信息:
    # uname -a
    Linux xxxxxxxx 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    
    # lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 14.04.5 LTS
    Release:        14.04
    Codename:       trusty
    

  • 我最近在不同的主机上使用了相同的指令,但操作系统相同,并且成功(2017 年 1 月中下旬?)。

  • 解决方法:如果 /etc/apt/sources.list.d/sbt.list 中的 https 更改为 http,则 apt-update 工作正常(不再匹配安装说明,并绕过使用的安全性HTTPS)。
  • 【问题讨论】:

    • 已删除,并移至“回答”部分

    标签: scala ubuntu sbt apt-get bintray


    【解决方案1】:
    • 我了解到,最近为区域内的所有 puppetized 主机配置了 http apt 缓存代理。从主机中删除 apt 缓存代理后,安装开始正常工作。
    • sbt.list 已恢复为使用 https 前缀。

    【讨论】:

      【解决方案2】:

      任何在 2021 年出现 403 的人都应该知道 bintray 有 been removed by JFrog 它的原始供应商。这会影响直到最近才通过 bintray 分发的 sbt。

      确认人

      cd /etc/apt/sources.list.d
      

      然后

      > grep bintray *
      sbt.list:deb https://dl.bintray.com/sbt/debian /
      sbt.list.save:deb https://dl.bintray.com/sbt/debian /
      

      如果您在 sbt.list 文件中看到 bintray,请执行

      rm sbt.list*
      

      并且 sudo apt update 不应再显示 403

      此时刷新sbt源可能是个主意,见here

      【讨论】:

        猜你喜欢
        • 2021-12-09
        • 1970-01-01
        • 2012-03-04
        • 1970-01-01
        • 1970-01-01
        • 2020-12-22
        • 2012-06-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多