错误:仓库'http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release'没有Release文件。

109
自从我在Debian 10上安装了Certbot之后,它总是显示这个错误:
root@HypeTime:/home/sinusbot# apt update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Ign:4 http://ppa.launchpad.net/certbot/certbot/ubuntu focal InRelease
Err:5 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
  404  Not Found [IP: 2001:67c:1560:8008::15 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal 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.

有人知道如何修复这个错误吗?


2
话虽如此,为什么你在Debian系统上使用Ubuntu存储库呢?特别是当主要Debian存储库中已经有certbot软件包时,而这也是官方指南告诉你要使用的 - Nate Eldredge
1
“focal”版本尚未发布。 也许您应该在sources.list中将focal更改为disco(在指向此PPA的文件中),同时仍要避免在Debian系统上使用Ubuntu存储库。 - Cyril Chaboisseau
这里也有同样的问题。Focal 报错 module 'acme.challenges' has no attribute 'TLSSNI01' - vinyll
8个回答

269

我通过移除ppa仓库来解决Ubuntu 20.04上的错误信息。花了我很长时间才找到确切的命令参数,希望这可以帮助其他人 :-). 我使用了以下命令:

sudo apt-add-repository -r ppa:certbot/certbot

之后,以下命令不会生成任何错误:

sudo apt update
sudo apt-get update

4
如果您想了解其他删除PPA软件源的方法(包括图形用户界面工具"软件和更新"),可以查看《如何在Ubuntu 20.04 Linux上列出和删除PPA软件源》。链接:https://linuxconfig.org/how-to-list-and-remove-ppa-repository-on-ubuntu-20-04-linux - jimbod119
这个答案已经过时了。请查看 certbot 的使用说明。 - Blake McBride
2
Cannot add PPA: 'ppa:certbot/certbot'. Please check that the PPA name or format is correct. - alper
@BlakeMcBride 如果您指的是一些具體的指示,您可以分享一個鏈接嗎? - YakovL
这个对我有效,两天后。 - malik kurosaki
显示剩余3条评论

38

我偶然发现了这些信息

$ sudo add-apt-repository ppa:certbot/certbot
This is the PPA for packages prepared by Debian Let's Encrypt Team and backported for Ubuntu.

Note: Packages are only provided for currently supported Ubuntu releases.
 More info: https://launchpad.net/~certbot/+archive/ubuntu/certbot
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:3 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Ign:5 http://ppa.launchpad.net/certbot/certbot/ubuntu focal InRelease
Get:6 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [588 kB]
Get:7 http://ca-central-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [666 kB]
Err:8 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
  404  Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal 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.

在Ubuntu 20.04上按照Ubuntu 18.04 certbot安装说明操作是错误的。正确的做法是按照Ubuntu 20.04 certbot安装说明执行,避免使用命令序列sudo add-apt-repository ppa:certbot/certbotsudo apt install python-certbot-nginx,而是直接执行。
sudo apt install certbot python3-certbot-nginx

请注意,20.04友好的命令在命令中使用python3而不仅仅是python
公平地说,我不是唯一一个处理这个问题的人。这篇其他文章提供了解决方案,提供了-r选项以删除存储库,帮助我找到了解决我的问题的方向。
请参见@vinyll的答案,其中包括“可使用卸载程序的一行Certbot安装。也适用于Ubuntu 20.04。”我没有选择这条路,因为我不太愿意在绝对确定其依赖关系之前卸载软件包。由于当时我不是100%确定,所以按照适当操作系统的安装说明更容易,而不是冒着在不知情的情况下消除所需依赖项的风险进行卸载。

29

最新源码完全正常,可以使用一行代码安装Certbot证书工具


curl -o- https://raw.githubusercontent.com/vinyll/certbot-install/master/install.sh | bash

这对我有帮助,等certbot PPA再次修复后也可以进行卸载。


尽管这仍然有效且在希望安装最新版本时很有意义,但PPA现在发布了一个升级版,在Focal上安装certbot。 - vinyll

13

请使用以下命令:

sudo apt-add-repository -r ppa:certbot/certbot

再运行以下命令更新软件包列表:

sudo apt update


对我来说不起作用。当我执行你的第二个命令(sudo apt update)时,我得到另一个404错误和相同的错误提示。 - pabrams

4

我最近使用这个命令安装了certbot:
sudo snap install --classic certbot


2
谢谢!我在Ubuntu 20.04服务器上遇到了问题,最终运行了这个命令。只是想说一句,这应该作为完整的certbot安装过程的一部分来执行 - 指令在https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx中,否则可能会遇到一些旧版certbot包的问题。 - Daniel Vieira
@AndrewSwift,感谢您保持答案的最新状态。 - Giorgi Gvimradze

1
有些PPA由其创建者/维护者不会更新到新的Linux版本。因此,您需要删除它们。 要在不删除整个PPA的情况下执行此操作,您可以使用以下指南: safely-remove-ppa-repositories-ubuntu 如果PPA版本与您的Linux版本不兼容,则需要更新它。 对于任何此类PPA错误的问题,此答案都是通用的,因此我希望这是回答它的正确地方。

1

我认为最近的解决方案有所不同。

首先,只需使用--classic从snap安装"certbot"

snap install certbot --classic

然后从"软件和更新"中删除其他软件包,选择"其他软件"选项卡,然后选择要删除的所有其他软件包。

enter image description here

然后在终端中通过"Sudo apt update"检查它。如果没有问题,您将不会收到错误提示:

enter image description here


1

@vinyll的回答对我处理Ubuntu server 20.04非常有帮助。

只是有一个小问题:它会安装当前存储库的最新版本,目前是1.9.0.dev0

我建议查看Certbot repository以获取所需的发布标签 - 在我的情况下为v1.8.0,指的是刚发布的版本1.8.0 - 并编辑脚本以"检出"它。

脚本将变为(安装Certbot v1.8.0):

#!/bin/bash

ROOT=~/.certbot-src

# Remove older versions if existing, for a simple re-install/update.
rm -rf $ROOT

# Clone certbot source.
git clone https://github.com/certbot/certbot $ROOT

# Check if python3-venv is installed, and install it otherwise.
CHECK_PACKAGES='python3-venv'
if ! dpkg -s $CHECK_PACKAGES >/dev/null 2>&1; then
  echo "The packages '$CHECK_PACKAGES' are not installed. "
  echo "They will now be installed automatically with 'sudo apt-get install $CHECK_PACKAGES'."
  sudo apt-get install -y $CHECK_PACKAGES
fi

# Checkout the desired release TAG.
cd $ROOT
git checkout v1.8.0 # Replace v1.8.0 with the TAG you chosen

# Setup virtual environment for certbot.
sudo apt-get install -y python3-dev python3-venv gcc libaugeas0 libssl-dev libffi-dev ca-certificates openssl
python3 tools/venv3.py

# Link installed certbot version, so it can used everywhere.
sudo ln -s $ROOT/venv3/bin/certbot /usr/local/bin/

注意: 如果您想进行干净的安装并且要删除旧的Certbot版本,请小心操作 - 例如,使用apt purge certbotapt autoremove --purge certbot可能会删除配置文件,导致新的Certbot安装处于不一致的状态; 这个答案可能会有所帮助。



软件包 'python-virtualenv' 没有可安装的候选项。 - Aadam

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接