4

I'm trying to install certbot in my ubuntu 16.04.3 server, the same commands that work with 16.04.2 won't do it. The python installed is default Python 2.7.12

This is the installation script:

#!/bin/bash

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx 

And this is the output

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: certbot (>= 0.17.0~) but it is not going to be installed
                        Depends: python-acme but it is not going to be installed
                        Depends: python-certbot but it is not going to be installed
                        Depends: python-mock but it is not going to be installed
                        Depends: python-openssl but it is not going to be installed
                        Depends: python-pkg-resources but it is not going to be installed
                        Depends: python-zope.interface but it is not going to be installed
                        Depends: python:any (< 2.8)
                        Depends: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages.

If I try this

sudo apt-get install python-pkg-resources

I get

The following packages have unmet dependencies:
 python-pkg-resources : Depends: python:any (< 2.8)
                        Depends: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages

What I have already tried

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install -f
sudo apt-get install --reinstall python2.7

More info

$ apt-cache policy python
python:
  Installed: 2.7.12-1
  Candidate: 2.7.12-1
  Version table:
 *** 2.7.12-1 100
        100 /var/lib/dpkg/status
     2.7.11-1 500
        500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
Gus
  • 163
  • 1
  • 7
  • On my installed-last-week 16.04.x Ubuntu server the package is called `letsencrypt` not `certbot` - no ppa/etc needed, it is in the repos. Any reason not to use that instead of trying the PPA ? – ivanivan Jan 15 '18 at 01:45

2 Answers2

1

I know it doesn't solve your problem (sorry), but it may help others. I was having the same problem and found the solution in https://github.com/certbot/certbot/issues/5247 - enabling the universe repo - add-apt-repository universe

Javier Arias
  • 111
  • 4
0

This type of problem is common in partially completed upgrades, or with failed package installs.

The following packages have unmet dependencies:
python-pkg-resources : Depends: python:any (< 2.8)
                       Depends: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages

What does dpkg --get-selections | grep hold show? Can you remove, install or reinstall these? Can you run dpkg --configure -a to try to 'finish' any stuck installs?

Alternatively, do you have sources files for multiple different ubuntu releases in /etc/apt/sources.list or /etc/apt/sources.list.d (from an upgrade that never completed properly?)

Finally, what does sudo aptitude install python-certbot-nginx suggest (aptitude can have better/deeper dependency logic resolution, though be careful that some of it's suggestions may be a bit too crazy!)

womble
  • 96,255
  • 29
  • 175
  • 230
match
  • 148
  • 7