Debian
Debian 打包:mk-build-deps 無法安裝特定版本的 Build-Depends 軟體包
我需要建構一個依賴於特定版本的第三方庫的項目:
➜ cat debian/control Source: libhole-cpp Priority: optional Maintainer: Vitaly Isaev <isaev@embarce.ro> Build-Depends: debhelper (>= 9), cmake, flatbuffers (= 1.2.0-1), libboost-dev, libboost-system-dev, catch Standards-Version: 3.9.5
但是,我們的 repo 中有幾個
flatbuffers
包,包括較新的包:➜ apt-cache policy flatbuffers flatbuffers: Installed: (none) Candidate: 1.4.0-17 Version table: 1.4.0-17 500 500 http://repo12.mailbuild-2.embarce.ro xenial/local amd64 Packages 1.2.0-1 500 500 http://repo12.mailbuild-2.embarce.ro xenial/local amd64 Packages
在這種情況下
mk-build-deps
拒絕安裝所需版本的軟體包:➜ sudo mk-build-deps --install debian/control dh_testdir dh_testroot dh_prep dh_testdir dh_testroot dh_install dh_installdocs dh_installchangelogs dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb dpkg-deb: building package 'libhole-cpp-build-deps' in '../libhole-cpp-build-deps_1.0.1ubuntu1_all.deb'. The package has been created. Attention, the package has been created in the current directory, not in ".." as indicated by the message above! Selecting previously unselected package libhole-cpp-build-deps. (Reading database ... 68846 files and directories currently installed.) Preparing to unpack libhole-cpp-build-deps_1.0.1ubuntu1_all.deb ... Unpacking libhole-cpp-build-deps (1.0.1ubuntu1) ... Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies...Starting pkgProblemResolver with broken count: 1 Starting 2 pkgProblemResolver with broken count: 1 Investigating (0) libhole-cpp-build-deps [ amd64 ] < 1.0.1ubuntu1 > ( devel ) Broken libhole-cpp-build-deps:amd64 Depends on flatbuffers [ amd64 ] < none -> 1.4.0-17 > ( devel ) (= 1.2.0-1) Considering flatbuffers:amd64 0 as a solution to libhole-cpp-build-deps:amd64 -2 Removing libhole-cpp-build-deps:amd64 rather than change flatbuffers:amd64 Done Done Starting pkgProblemResolver with broken count: 0 Starting 2 pkgProblemResolver with broken count: 0 Done The following packages will be REMOVED: libhole-cpp-build-deps 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 9216 B disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 68850 files and directories currently installed.) Removing libhole-cpp-build-deps (1.0.1ubuntu1) ... mk-build-deps: Unable to install libhole-cpp-build-deps at /usr/bin/mk-build-deps line 402. mk-build-deps: Unable to install all build-dep packages ➜ libhole-cpp git:(v12) ✗ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
誰能澄清我的建構工具鏈有什麼問題?作業系統是 Ubuntu 16.04。
tldr;
通過以下方式委託給
aspcud
求解器apt-cudf-get
:mk-build-deps \ --install \ --remove \ --tool \ 'apt-cudf-get --solver aspcud -o APT::Get::Assume-Yes=1 -o Debug::pkgProblemResolver=0 -o APT::Install-Recommends=0' \ debian/control
解釋
這個解決方案與Johannes Schauer的不同之處在於……
它使用
apt-cudf-get
而不是apt-get
它省略了以下選項(在我的測試中不起作用):
-o APT::Solver::Strict-Pinning=false
-o APT::Solver::aspcud::Preferences="-new,-removed,-changed"
它添加了以下選項:
-o APT::Get::Assume-Yes=1
(以非互動方式安裝包)-o Debug::pkgProblemResolver=1
(mk-build-deps --tool
預設)-o APT::Install-Recommends=0
(mk-build-deps --tool
預設)參考:
“mk-build-deps 無法安裝特定版本的 Build-Depends 軟體包”的 debian-devel 郵件列表執行緒索引:https ://lists.debian.org/debian-devel/2016/08/threads.html#00442
- Vitaly Isaev 啟動執行緒:https ://lists.debian.org/debian-devel/2016/08/msg00442.html
- Johannes Schauer,提議 aspcud:https ://lists.debian.org/debian-devel/2016/08/msg00446.html
aspcud
apt-cudf
Debian 軟體包:https ://packages.debian.org/stable/apt-cudf
apt-cudf
Debian 手冊頁:https ://manpages.debian.org/stable/apt-cudf/apt-cudf-get.8.html
apt-cudf-get
Debian 手冊頁:https ://manpages.debian.org/stable/apt-cudf/apt-cudf.1.html
mk-build-deps
Debian 手冊頁:https ://manpages.debian.org/stable/devscripts/mk-build-deps.1.html