使用 bintray 运行 apt-get update 时获取失败

使用 bintray 运行 apt-get update 时获取失败

在 ubuntu 20.04.2 LTS 上运行sudo apt-get update出现此错误:

Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Ign:2 http://binaries.erlang-solutions.com/debian focal InRelease
Hit:3 http://binaries.erlang-solutions.com/debian focal Release
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:6 https://packages.microsoft.com/ubuntu/21.04/prod hirsute InRelease
Hit:7 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:8 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Err:9 https://dl.bintray.com/sbt/debian  InRelease
  403  Forbidden [IP: 35.155.141.94 443]
Hit:10 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
E: Failed to fetch https://dl.bintray.com/sbt/debian/InRelease  403  Forbidden [IP: 35.155.141.94 443]
E: The repository 'https://dl.bintray.com/sbt/debian  InRelease' is no longer signed.
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.

我如何才能运行更新而不出现此错误?是否需要以某种方式删除此存储库以获取更新?

dotnet我做的最后一件事是尝试在我的系统上安装 sdk :

wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

但是我已经有一段时间没有运行更新了,所以也许是其他原因......

更新

由于这个错误,我现在无法更新我的服务器。有没有办法跳过这个存储库?这个包会被所有人读取吗?还是只有我的实例会读取,因为我试图安装一个包,现在它已将此存储库添加到我的资源列表中以检查更新?

更新 2

ls -alFh /etc/apt/sources.list.d

drwxr-xr-x 7 root root 4.0K Nov 22 16:08 ../
-rw-r--r-- 1 root root  183 Dec  3 12:25 erlang-solutions.list
-rw-r--r-- 1 root root  183 Dec  3 12:25 erlang-solutions.list.save
-rw-r--r-- 1 root root   91 Dec  3 12:25 microsoft-prod.list
-rw-r--r-- 1 root root   91 Dec  3 12:25 microsoft-prod.list.save
-rw-r--r-- 1 root root   40 Dec  3 12:25 sbt.list
-rw-r--r-- 1 root root   40 Dec  3 12:25 sbt.list.save

猫/etc/apt/sources.list

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://archive.ubuntu.com/ubuntu/ focal universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted
deb http://security.ubuntu.com/ubuntu/ focal-security universe
# deb-src http://security.ubuntu.com/ubuntu/ focal-security universe
deb http://security.ubuntu.com/ubuntu/ focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu focal stable

答案1

Err:9 https://dl.bintray.com/sbt/debian  InRelease     
 403  Forbidden [IP: 35.155.141.94 443]     
 ...   
E: Failed to fetch https://dl.bintray.com/sbt/debian/InRelease  403  Forbidden [IP: 35.155.141.94 443]   
E: The repository 'https://dl.bintray.com/sbt/debian  InRelease' is no longer signed.    
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

这意味着该仓库不可公开访问 [2]。

你该怎么办:

  1. 删除旧的 Repo

    sudo add-apt-repository --remove "deb http://dl.bintray.com/sbt/debian /"   
    sudo rm -fv /etc/apt/sources.list.d/sbt.list
    sudo rm -fv /etc/apt/sources.list.d/sbt.list.save
    sudo apt update
    

    根据您的来源列表,只需删除.list文件。

  2. 从新的 Repo 安装 sbt 包 [3]

    sudo apt install apt-transport-https curl gnupg -yqq
    echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
    echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
    curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
    sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
    sudo apt update
    sudo apt install sbt     
    

    或者您可以通过 sdk 管理器从 TGZ 档案安装 sbt 包:

    wget https://github.com/sbt/sbt/releases/download/v1.5.5/sbt-1.5.5.tgz     
    sudo tar xzvf sbt-1.5.5.tgz -C /usr/share/     
    sudo update-alternatives --install /usr/bin/sbt sbt
    sdk install sbt
    

此外
的 SSLhttps://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823可能无法在 18.04 上运行,因为它使用的是 gnupg。我们可以使用 Web API 下载公钥。运行:

sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823

希望这可以帮助。

有关的:

答案2

我将首先回答您的具体问题,......

  1. 我怎样才能运行更新而不出现此错误? 是否需要以某种方式删除该存储库以获取更新? 有没有办法可以以某种方式跳过这个存储库? (我将它们全部列在一起,因为它们的答案都相同)。是的,请参阅sudo mv ...下面建议的命令。
  2. 这个包会被所有人读取吗?还是只有我一个人这样,因为我试图安装一个包,现在它已将此 repo 添加到我的资源列表中以检查更新?由于更改是在系统范围的位置引入的,因此每个人都可以阅读它/etc/apt/sources.list.d/

...然后按如下方式展开。


你必须明确你想做什么。针对各种情况:
  1. 如果你只是想更新,请从你的/etc/apt/sources.list和中删除失败的存储库/etc/apt/sources.list.d/。你可以申请几种方法删除添加到的 ppas /etc/apt/sources.list.d/,例如只需将文件重新命名/etc/apt/sources.list.d/<myppa>.list为类似于<myppa>.list.save

     $ sudo mv /etc/apt/sources.list.d/sbt.list /etc/apt/sources.list.d/sbt.list.save
    

    这样,你就可以保留你的文件以防万一。这应该足以让你继续前进。

  2. 如果您还想更新sbt,请执行

     $ echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
     $ echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
     $ curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
     $ sudo apt update
     $ sudo apt install sbt
    

    命令略作修改这个官方来源apt-get-> apt)。旧仓库https://dl.bintray.com/loadimpact/debianhttps://dl.bintray.com/sbt/debian/sbt-1.5.5.deb现在forbidden。这类似于阿布·艾哈迈德·哈蒂里引号。

  3. 如果您想更新属于失败存储库的其他软件包,请澄清这一点,以便我们能够帮助解决具体情况。


我还注意到有关你们的 Microsoft 产品的几点意见。
  1. 你从 16.04 开始安装packages-microsoft-prod.deb。你应该安装该包正确的版本是 20.04

  2. 通常更安全使用sudo gdebi <pkg>.debsudo dpkg -i <pkg>.deb(如上文第 1 项所述)。在这种情况下,鉴于说明直接来自 MS,因此很可能相同。

  3. 你正在访问多毛 21.04Hit:6 https://packages.microsoft.com/ubuntu/21.04/prod hirsute InRelease(可能在你的 中microsoft-prod.list)。你应该删除它并添加 repo焦点 20.04。 跟随这些说明在下面Ubuntu 20.04(焦点)


我建议你在问题中发布
$ uname -a
$ cat /etc/apt/sources.list
$ ls -alFh /etc/apt/sources.list.d

有关的

  1. 无法再使用 sudo apt update。正在运行 20.04

答案3

Bintray 已关闭并且不再托管 sbt 存储库,因此您需要更新 sbt 存储库。

首先删除旧 sbt repo 的源列表文件。

sudo rm -f /etc/apt/sources.list.d/sbt*

还要检查/etc/apt/source.list文件并确保删除了旧 sbt 存储库的条目。

安装新的 sbt 存储库源列表和 gpg 密钥。

echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update

相关内容