在 ubuntu 20.04 上安装 Certbot

Ora*_*nes 9 certificates 20.04

我一直在关注几个教程将 ssl 添加到我的服务器(节点应用程序)。

我尝试在 Ubuntu 20.04 服务器上使用以下行安装 Certbot:

sudo add-apt-repository ppa:certbot/certbot
Run Code Online (Sandbox Code Playgroud)

但收到警告并且没有安装:

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.*
Run Code Online (Sandbox Code Playgroud)

在网上搜索后,提到不使用 PPA,而是使用早期的独立版本 - 也提到使用 snap - 但我找不到具体的答案。我使用的是 Express 而不是 nginX。

有人可以建议如何安装吗?

更新

sudo snap install certbot

结果:

error: This revision of snap "certbot" was published using classic confinement and thus may perform
   arbitrary system changes outside of the security sandbox that snaps are usually confined to,
   which may put your system at risk.
   If you understand and want to proceed repeat the command including --classic.
Run Code Online (Sandbox Code Playgroud)

B. *_*hea 11

您可以使用 APT、PIP 或 SNAP 在 Focal / Ubuntu 20.04 上安装

(APT 有效 - 至少目前如此。)

但是,不要使用多种安装方法,或混合使用它们。

听起来您可能有混合的安装方法。
您可能需要清除所有内容并重新开始?

首先运行这些命令来清理并删除 Certbot。
如果您已经创建了证书,则需要重新创建它们。
警告:以下行将完全删除 certbot 和文件!

 sudo apt remove certbot* --purge  
 sudo apt-add-repository --remove ppa:certbot/certbot  
 sudo apt update  
 sudo snap remove certbot  
 sudo -H pip3 uninstall certbot
 pip3 uninstall certbot
 sudo rm /usr/bin/certbot
 rm ~/.local/usr/bin/certbot
 rm ~/.local/bin/certbot
 sudo rm -rf /etc/letsencrypt
Run Code Online (Sandbox Code Playgroud)

只需忽略任何错误(未找到)。
这应该涵盖所有基础——包括系统范围和用户范围。

现在决定如何安装它。
选择一个且仅选择一个。请勿混用安装方法。

折断

安装按扣很容易,但我个人不喜欢使用它。我更喜欢使用 python pip (截至目前)。Snap 将是我的第二选择。

Certbot 站点上有针对 Ubuntu Focal 的详细记录,Snap已作为默认安装方法。

说明位于Certbot 网站。

易于

sudo apt show certbot

软件包:certbot
版本:0.40.0-1ubuntu0.1
优先级:额外
部分:universe/web
来源:python-certbot
来源:Ubuntu

https://packages.ubuntu.com/focal/certbot

APT版本一直落后很多版本。
这也不例外。
当前 APT 版本为 v0.40.0 ->(2019 年 11 月 5 日发布)。
当前的 PIP 和 SNAP 版本为 v1.19.0(截至 2021 年 10 月 1 日)。

我建议使用比 APT 提供的更新一点的东西。由于 Certbot 处理安​​全/SSL,有时 LetsEncrypt/Certbot 人员会进行更改,您肯定可能希望立即更新。如果您使用 APT 版本,您可能无法执行此操作。据我所知,您也不能将 Certbot PPA 用于 Ubuntu Focal/20

因此,请坚持使用pip -或- snap作为安装方法。


Nat*_*ate 7

他们已经摆脱了现在的 apt snap install certbot --classic