我在相当不受支持的机器上安装了 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).
Run Code Online (Sandbox Code Playgroud)
现在,虽然我能够管理 Unifi 的 ugprades(依赖项并不是很严格),但我无法再对剩余的软件包使用 apt upgrade。
有没有办法“跳过” unifi 和它的依赖项升级,因为我已经手动升级了 Unifi 并告诉 apt upgrade 其他所有内容而忽略 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).
Run Code Online (Sandbox Code Playgroud)
澄清。最终目标是升级除 UNIFI 和 MongoDB 之外的所有内容。Ubiquiti 的最新升级增加了对 mongodb 3.4 的 UNIFI 的依赖。如果你像我一样升级到 18.04,你会得到 3.6,这会破坏 Unifi。为了解决这个问题,我卸载了 Unifi,重新安装了 Unifi 并从备份中获取了配置,它在 3.6+ mongodb 上运行良好。我的猜测是 Ubiquiti 没有为其余用户自动执行此过程,因此为了稳定发布,他们添加了此依赖项。
现在因为我已经升级了,所以我需要让我的机器保持最新状态。所以现在我需要跳过 Unifi 升级(我直接从 dpkg 安装它们并跳过依赖项),但继续升级其他东西。
希望它能解释原因和最终目标。
虽然所有好的答案我都选择了不同的方法。为什么要修复 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
Run Code Online (Sandbox Code Playgroud)
查找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 <unifi-dev@ubnt.com>
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
Run Code Online (Sandbox Code Playgroud)
重新打包后:
dpkg-deb -b temporary unifi-fixed.deb
dpkg-deb: building package 'unifi' in 'unifi-fixed.deb'.
Run Code Online (Sandbox Code Playgroud)
只需安装dpkg -i unifi-fixed.deb. 安装后apt update,apt upgrade工作!
| 归档时间: |
|
| 查看次数: |
7243 次 |
| 最近记录: |