0

Following instructions on here https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx I tried to run this command:

sudo apt-get install python-certbot-nginx 

But I get the following error:

~$sudo apt-get install python-certbot-nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-certbot-nginx : Depends: python3-certbot-nginx but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Attempting to install python3-certbot-nginx shows a few further details:

~$ sudo apt-get install python3-certbot-nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-certbot-nginx : Depends: certbot (>= 0.25.0~) but it is not going to be installed
                         Depends: python3-acme but it is not going to be installed
                         Depends: python3-certbot but it is not going to be installed
                         Depends: python3-mock but it is not installable
                         Depends: python3-pyparsing (>= 1.5.5) but it is not installable
E: Unable to correct problems, you have held broken packages.

I ran sudo apt upgrade and several things were upgraded, but I still got the same error. The upgrade command refused to upgrade these three items: liblxc1, lxd, lxd-client (not sure why)

I then tried to use the certbot-auto tool, and seemed to run into a similar problem:

~$ wget https://dl.eff.org/certbot-auto
~$ chmod a+x ./certbot-auto
~$ sudo ./certbot-auto --install-only
Bootstrapping dependencies for Debian-based OSes... (you can skip this with --no-bootstrap)
Hit:1 http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease
Hit:2 http://azure.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:4 https://repos.influxdata.com/ubuntu xenial InRelease
Hit:5 https://nginx.org/packages/mainline/ubuntu xenial InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gcc is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  gcc-5-doc

Package libffi-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-virtualenv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python

E: Package 'python-dev' has no installation candidate
E: Package 'python-virtualenv' has no installation candidate
E: Package 'gcc' has no installation candidate
E: Package 'libffi-dev' has no installation candidate

I'm not sure where to go from here. Any idea why this is happening and how to resolve the issue?

1 Answer 1

4

What I did to solve this problem on 18.04. See if you have python not just python3 installed.

python -V

Should give you a version number. If not:

sudo apt install python

Then you can add the python certbot. You'll need to add the repository that has it:

sudo add-apt-repository universe

Then you should be able to:

sudo apt-get install python-certbot-nginx 

You can search for repositories here: https://packages.ubuntu.com/search?keywords=python-certbot-nginx&searchon=names&suite=bionic&section=all

4
  • 1
    python -V returns Python 2.7.12. sudo apt install python returns python is already the newest version (2.7.12-1~16.04). Both Python 3 and Python 2 are installed. I can launch Python 3 via python3 which yields a Python 3.5.2. And running just python launches Python 2.
    – Jim
    Aug 4, 2018 at 10:10
  • OK. Since python 2x is already installed you can go to the next step. Did the rest of the post help? Adding the universe repository and then installing python-certbot-nginx?
    – gorelog
    Aug 10, 2018 at 3:20
  • Unfortunately I still get the exact same error ("packages have unmet dependencies"), even after adding universe and rerunning the apt-get install python-certbox-nginx.
    – Jim
    Aug 11, 2018 at 7:52
  • 1
    install python and add universe got me over the hump for the Apache version
    – WernerCD
    Sep 1, 2018 at 22:57

You must log in to answer this question.

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