首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在ubuntu 16.04.3上安装certbot

无法在ubuntu 16.04.3上安装certbot
EN

Server Fault用户
提问于 2017-10-05 19:50:54
回答 2查看 4.8K关注 0票数 4

我试图在我的ubuntu16.04.3服务器上安装certbot,使用16.04.2的相同命令无法做到这一点。安装的python是默认的Python2.7.12

这是安装脚本:

代码语言:javascript
复制
#!/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 

这是输出

代码语言:javascript
复制
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.

如果我试试这个

代码语言:javascript
复制
sudo apt-get install python-pkg-resources

我得到了

代码语言:javascript
复制
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

我已经尝试过的

代码语言:javascript
复制
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install -f
sudo apt-get install --reinstall python2.7

更多信息

代码语言:javascript
复制
$ 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
EN

回答 2

Server Fault用户

发布于 2018-06-01 11:13:16

我知道它不能解决你的问题(对不起),但它可能会帮助别人。我也遇到了同样的问题,并在https://github.com/certbot/certbot/issues/5247中找到了解决方案--启用宇宙回购- add-apt-repository universe

票数 1
EN

Server Fault用户

发布于 2018-01-14 22:23:53

这种类型的问题在部分完成的升级或安装失败的包时很常见。

代码语言:javascript
复制
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

dpkg --get-selections | grep hold展示了什么?你能移除,安装或重新安装这些吗?你能运行dpkg --configure -a来尝试“完成”任何卡住的安装吗?

或者,在/etc/apt/sources.list/etc/apt/sources.list.d中是否有多个不同的ubuntu版本的源文件(来自从未正确完成的升级?)

最后,sudo aptitude install python-certbot-nginx提出了什么(智能可以有更好/更深层次的依赖逻辑解决方案,不过要小心,其中一些建议可能有点疯狂!)

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/877130

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档