以下软件包具有未满足的依赖关系:unifi

以下软件包具有未满足的依赖关系:unifi

我已经在不受支持的机器上安装了 Unifi:

root@EvoWebsites:/home/pklys# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 unifi : Depends: mongodb-server (< 1:3.6.0) but 1:3.6.3-0ubuntu1 is installed or
                  mongodb-10gen (< 3.6.0) but it is not installable or
                  mongodb-org-server (< 3.6.0) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

现在,虽然我能够管理 Unifi 的升级(对它的依赖性并不是很严格),但我无法再对剩余的软件包使用 apt upgrade。

有没有办法“跳过”unifi 及其依赖项升级,因为我已经手动升级了 Unifi,并告诉 apt 升级其他所有内容,而忽略 Unifi 所说的内容?

我尝试过的:

    root@EvoWebsites:/home/pklys# apt-mark hold unifi
unifi was already set on hold.
root@EvoWebsites:/home/pklys# apt update
Hit:1 http://ppa.launchpad.net/ondrej/apache2/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:3 http://pl.archive.ubuntu.com/ubuntu bionic InRelease
Get:4 http://pl.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://pl.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://pl.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [322 kB]
Get:7 http://pl.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [286 kB]
Get:8 http://pl.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [192 kB]
Get:9 http://pl.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [192 kB]
Get:10 http://pl.archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages [4,360 B]
Get:11 http://pl.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [4,200 B]
Fetched 1,247 kB in 1s (2,426 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
98 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@EvoWebsites:/home/pklys# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 unifi : Depends: mongodb-server (< 1:3.6.0) but 1:3.6.3-0ubuntu1 is installed or
                  mongodb-10gen (< 3.6.0) but it is not installable or
                  mongodb-org-server (< 3.6.0) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

澄清一下。最终目标是升级除 UNIFI 之外的所有内容,如果不可能,则升级 MongoDB。Ubiquiti 在其最新升级中将对 UNIFI 的依赖添加到了 mongodb 3.4。如果您像我一样升级到 18.04,您将获得 3.6,这会破坏 Unifi。为了解决这个问题,我卸载了 Unifi,重新安装了 Unifi 并从备份中获取了配置,它在 3.6+ mongodb 上运行良好。我猜 Ubiquiti 没有为剩余用户自动执行此过程,因此在稳定版本中他们添加了此依赖项。

现在,由于我已经升级,我需要让我的机器保持最新状态。所以现在我需要跳过 Unifi 升级(我直接从 dpkg 安装它们并跳过依赖项),但继续升级其他东西。

希望它能解释原因和最终目标。

答案1

虽然所有答案都很好,但我选择了不同的方法。为什么我要修复 Ubuntu,而我可以修复 Unifi 包!

完整故事请见此处:https://evotec.xyz/ubuntu-18-04-fixing-unifi-deb-package-to-run-with-3-6-mongodb/

但想法是下载包,解压包

cd /home/username
wget https://dl.ubnt.com/unifi/5.9.29/unifi_sysvinit_all.deb
mkdir tmp
dpkg-deb -R unifi_sysvinit_all.deb tmp

找到DEBIAN\control文件并从 Depends 部分中删除第 7-8 行。

Package: unifi
Version: 5.9.29-11384-1
Section: java
Priority: optional
Architecture: all
Depends: binutils, coreutils, adduser, libcap2, curl,
 mongodb-server (>= 2.4.10) | mongodb-10gen (>= 2.4.14) | mongodb-org-server (>= 2.6.0),
 mongodb-server (<< 1:3.6.0) | mongodb-10gen (<< 3.6.0) | mongodb-org-server (<< 3.6.0),
 java8-runtime-headless, jsvc (>=1.0.8)
Pre-Depends: debconf (>= 0.5) | debconf-2.0
Conflicts: unifi-controller
Provides: unifi-controller
Replaces: unifi-controller
Installed-Size: 143115
Maintainer: UniFi developers <[email protected]>
Description: Ubiquiti UniFi server
 Ubiquiti UniFi server is a centralized management system for UniFi suite of devices.
 After the UniFi server is installed, the UniFi controller can be accessed on any
 web browser. The UniFi controller allows the operator to instantly provision thousands
 of UniFi devices, map out network topology, quickly manage system traffic, and further
 provision individual UniFi devices.
Homepage: http://www.ubnt.com/unifi

重新打包之后:

dpkg-deb -b tmp unifi-fixed.deb
dpkg-deb: building package 'unifi' in 'unifi-fixed.deb'.

只需简单安装即可dpkg -i unifi-fixed.deb。安装后apt update即可apt upgrade使用!

答案2

对于 MongoDB 3.4,请尝试以下操作。

首先删除 MongoDB 的所有列表文件

sudo rm /etc/apt/sources.list.d/mongodb*

接下来,添加密钥

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A15703C6

现在添加 3.4 的存储库

sudo bash -c 'echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.4.list'

现在运行更新并升级

sudo apt update
sudo apt upgrade

答案3

您有一个软件包 ( unifi) 具有未满足的依赖项。Apt 打包系统将未满足的依赖项视为一个大问题,并会不断抱怨,直到问题得到解决。没有其他方法可以阻止它。

为了解决这个问题,您必须安装缺少的依赖项或删除unifi

相关内容