我刚刚安装了 Ubuntu Server 16.10,并希望安装 Mosquitto。运行时sudo apt-get install mosquitto
,我总是收到以下错误:
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:
mosquitto : Depends: sysv-rc (>= 2.88dsf-24) but it is not installable or
file-rc (>= 0.8.16) but it is not installable
Depends: libwebsockets3 (>= 1.2) but it is not installable
N: Ignoring file 'index.html' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Unable to correct problems, you have held broken packages.
我尝试按照http://mosquitto.org/download首先安装 PPA,使用-f
aptitude 来修复依赖问题这个帖子,根据将下载服务器更改为 Main这个帖子和这个帖子,每次都得到相同的结果。
我尝试手动安装这些依赖项,但不出所料,它们都返回如下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sysv-rc 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:
init-system-helpers
N: Ignoring file 'index.html' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Package 'sysv-rc' has no installation candidate
如果有任何问题,init-system-helpers 已经安装了 1.45 版本。我已经记住使用它sudo apt-get update
并尝试重新启动了几次。
我对 Ubuntu 并不陌生,但昨晚我花了 4 个多小时研究这个问题,却还是搞不懂。我在网上甚至找不到一个遇到同样问题的人。有什么办法可以解决这个问题吗?
提前谢谢您!
答案1
这不是我想要的答案,但是一个我发现有效的答案是擦除它并安装 Ubuntu 16.04。之后安装了 Mosquitto sudo apt-get install mosquitto
。
答案2
我也遇到了同样的问题。
我认为 ppa 有问题。我的解决方案是删除 中的 mosquitto 配置/etc/apt/sources.list.d
,也就是撤消apt-add-repository
命令。然后从 ubuntu 官方 repo 安装 mosquitto,版本为 1.4.8,取决于 libwebsockects7。
ppa 中的 mosquitto 版本为 1.4.9,但它依赖于 libwebsockets3,后者看起来更旧,并且已从官方存储库中删除。这就是您无法安装 deps 的原因。