18

I am trying to get SSL certificate with Let's Encrypt nginx on Amazon Linux 2023.

  • First, I added EPEL using the commands
    wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    
    and
    sudo rpm -ihv --nodeps ./epel-release-latest-8.noarch.rpm
    
    and it installed with no problem
  • Then I tried
    sudo yum install python3-certbot-nginx
    
    and got the error message:
    Problem: package certbot-1.22.0-1.el8.noarch requires python3-certbot = 1.22.0-1.el8, 
    but none of the providers can be installed
      - conflicting requests
      - nothing provides python3.6dist(setuptools) >= 39.0.1 needed by python3-certbot-1.22.0-1.el8.noarch
      - nothing provides python3.6dist(cryptography) >= 2.5.0 needed by python3-certbot-1.22.0-1.el8.noarch
      - nothing provides python3.6dist(configobj) >= 5.0.6 needed by python3-certbot-1.22.0-1.el8.noarch
      - nothing provides python3.6dist(distro) >= 1.0.1 needed by python3-certbot-1.22.0-1.el8.noarch
      - nothing provides /usr/bin/python3.6 needed by python3-certbot-1.22.0-1.el8.noarch
      - nothing provides python3.6dist(pytz) needed by python3-certbot-1.22.0-1.el8.noarch
      - nothing provides python(abi) = 3.6 needed by python3-certbot-1.22.0-1.el8.noarch
      (try to add '--skip-broken' to skip uninstallable packages)
    
  • I also tried
    sudo dnf install python3-certbot-nginx
    
    but got a similar error.

I learned I may need a code ready builder but haven't been able to install it. Please how can I get it. If that is not the issue, please what I'm I doing wrong and how can I resolve it?

4 Answers 4

20

I managed to get certbot installed in Amazon Linux 2023 in /opt/certbot/bin/certbot using the following commands:

sudo dnf install -y augeas-libs
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot

Or if you wanted a specfic version of certbot installed you could replace the last command with:

sudo /opt/certbot/bin/pip install certbot==2.6.0

In our setup we use the standalone mode with some hooks instead of using plugins. If you want to use plugins like dns, apache or nginx you should modify the last install command to something like pip install certbot-apache.

2
9

Thank you to Jens for getting me on the right track. However, I found I needed additional steps to get it fully working. You may also need the module(s) for your specific web server software, and I wanted to be able to invoke "certbot" as a command from wherever. So I had to change that last line and add another to do those things:

sudo dnf install -y augeas-libs
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-apache
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot

Alter to match your web server software as necessary.

1
  • 1
    Good points. In our setup we use the standalone mode, so we had no need for plugins and we also use absolute paths. But I have updated my answer to include a note about plugins. Aug 28, 2023 at 8:54
3

It appears the EPEL 8 version of Certbot is built for a version of Python (v3.6) that is not available in Amazon Linux 2023.

I found this note that seems to indicate that none of the EPEL repositories are compatible with Amazon Linux 2023.

According to the Amazon Linux 2023 documentation on installing Certbot it looks like they suggest installing Certbot using pip from the default version of Python3 into a virtual environment. You should also be able to pip install certbot-nginx to get the nginx plugin

EDIT

It looks like the linked AWS documentation no longer has instructions for installing certbot, but they do link to the official certbot installation instructions which still mentions that pip is one of the alternative installation methods.

2
  • The linked page about certbot in a virtual environment no longer mentions anything of the sort.
    – Basic
    Apr 25, 2023 at 18:09
  • These instructions let me have certbot working perfectly in a new fresh Amazon Linux 2023 EC-2 instance = certbot.eff.org/instructions?ws=nginx&os=pip Jul 22, 2023 at 16:47
0
sudo dnf install -y augeas-libs
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-nginx 

This was working for me, but the symlink did not work so I used certbot directly from the /opt location

sudo /opt/certbot/bin/certbot certonly --nginx .... 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .