從原始碼建立 network-manager-applet ubuntu 套件時套件版本衝突

從原始碼建立 network-manager-applet 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並 cd 到源文件夾並構建自己來處理程式碼,但在這種情況下我最終會處於相同的位置。上述一系列步驟應該適合以下目的:解決這個問題。)

感謝您的幫忙!

答案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: sudo aptitude 安裝 libnm-dev

再次,它應該提供各種解決方案來解決依賴性問題。

另一個選擇是直接指定libnm0的版本libnm-dev 想要:

sudo apt install libnm0=1.10.6-2ubuntu1.1

但這僅適用於您的儲存庫中的版本(在 /etc/apt/sources.list 等中指定)。

相關內容