从源代码构建网络管理器小程序 ubuntu 包时发生包版本冲突

从源代码构建网络管理器小程序 ubuntu 包时发生包版本冲突

我使用的是 xubuntu 18.04,它有一个 XFCE 用户界面,使用几个 GNOME 小部件,特别是网络管理器。网络管理器有一些限制,例如缺乏通过拖放确定网络优先级的方法。我知道 CLI 方式可以做到这一点,但我想将此功能贡献给 GUI,所以我尝试network-manager-applet从源代码编译以准备为其贡献代码。

我的系统包已更新为apt-get updateapt-get upgrade

如果我输入:

apt-get source network-manager-applet --compile

我得到:

dpkg-checkbuilddeps: error: Unmet build dependencies: dh-translations gnome-common libnm-util-dev (>= 1.8) libnm-glib-dev (>= 1.8) libnm-glib-vpn-dev (>= 1.8) network-manager-dev (>= 1.8) libnm-dev (>= 1.8) libmm-glib-dev libjansson-dev (>= 2.7) libselinux-dev libappindicator3-dev libdbusmenu-gtk3-dev (>= 16.04) libgcr-3-dev (>= 3.14) libgck-1-dev (>= 3.14) libgirepository1.0-dev gobject-introspection gtk-doc-tools libgtk-3-doc libglib2.0-doc
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
E: Build command 'cd network-manager-applet-1.8.10 && dpkg-buildpackage -b -uc' failed.

好的,足够公平,所以我查找了如何获取依赖项:

sudo apt-get build-dep network-manager-applet
Reading package lists... Done
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:
 builddeps:network-manager-applet : Depends: libnm-dev (>= 1.8) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

好的,让我们尝试安装libnm-dev

boutell@roxnsox:~/xubuntu$ sudo apt-get install libnm-dev
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:
 libnm-dev : Depends: libnm0 (= 1.10.6-2ubuntu1.1) but 1.10.14-0ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

请注意,我没有持有包裹:

boutell@roxnsox:~/xubuntu$ dpkg --get-selections | grep hold
boutell@roxnsox:~/xubuntu$ 

我该如何解决冲突libnm0才能继续前进?

(我知道我最终将不得不离开--compile并进入源文件夹并自行构建以处理代码,但在那种情况下我最终会回到同一个地方。上述一系列步骤应该有助于解决这个问题。)

感谢您的帮助!

答案1

这一行:

libnm-dev : Depends: libnm0 (= 1.10.6-2ubuntu1.1) but 1.10.14-0ubuntu2 is to be installed

建议您使用比您现有的 libnm-dev 兼容的更新版本的 libnm0;我认为,这有点措辞不当。

sudo apt purge libnm0 && sudo apt install libnm-dev

将删除您的 libnm0 版本并通过指定 libnm-dev 来执行安装,这将引入其所需的依赖项。

如果仍然收到依赖性错误,请回复。

仅供参考aptitude将寻找依赖问题的其他解决方案。因此,对于您而言,在交互模式 ( ) 下,sudo aptitude当您指定“安装 libnm-dev”时(通过单击+相应的条目;搜索然后/键入您的关键字),它会说有些东西坏了并建议您按下e,然后您可以使用,/.来查看解决方案列表。

你可以像在终端中aptitude一样使用apt:须藤能力安装 libnm-dev

并且,它应该提供各种解决方案来解决依赖问题。

另一种选择是直接指定 libnm0 的版本libnm-dev 想要:

sudo apt install libnm0=1.10.6-2ubuntu1.1

但只有当该版本位于您的存储库中(在 /etc/apt/sources.list 等中指定)时才有效。

相关内容