告诉APT使用从源安装的软件包进行依赖

我在一个覆盆子pi(我用作我的咨询业务的Web服务器),我正在尝试安装包php7.0-dev。 但是,如果我有这个问题:

sudo apt-get install php7.0-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: php7.0-dev : Depends: libtool (>= 2.4.6-0.1~) but 2.4.2-1.11 is to be installed Recommends: dh-php but it is not going to be installed Recommends: pkg-php-tools but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

问题似乎是libtool是pi的版本库中的旧版本。 为了解决这个问题,我刚刚下载了libtool 2.4.6的源代码并安装了它。 但是,如果我再次运行上述我仍然得到相同的错误。

有没有办法告诉APT使用libtool我安装的依赖?

这是libtool的path

 apt-cache showpkg libtool Package: libtool Versions: 2.4.6-2 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_stretch_main_binary-armhf_Packages) Description Language: File: /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages MD5: 40ea3da4a4ea75419ad95742898b3e52 2.4.2-1.11 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages) (/var/lib/dpkg/status) Description Language: File: /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages MD5: 40ea3da4a4ea75419ad95742898b3e52 Reverse Depends: dh-autoreconf,libtool 2.4.2 xfce4-dev-tools,libtool wireshark-dev,libtool ui-auto,libtool 1.5.8 slapos-node-unofficial,libtool shtool,libtool ruby-build,libtool proftpd-dev,libtool php7.0-dev,libtool 2.4.6-0.1~ php5-dev,libtool 2.4.6 php5-dev,libtool 2.2 multimedia-devel,libtool mm-common,libtool mate-common,libtool libtool-bin,libtool 2.4.2-1.8~ libtool-bin,libtool 2.4.6-2 liblua5.1-0-dev,libtool libltdl-dev,libtool 1.5.20 libltdl-dev,libtool 1.5.20 libltdl-dev,libtool gnome-common,libtool gcc,libtool dh-lua,libtool dh-autoreconf,libtool 2.4.2 autoconf,libtool anjuta,libtool xfce4-dev-tools,libtool wireshark-dev,libtool ui-auto,libtool 1.5.8 slapos-node-unofficial,libtool shtool,libtool ruby-build,libtool proftpd-dev,libtool php5-dev,libtool 2.2 php5-dev,libtool 2.2 packaging-dev,libtool multimedia-devel,libtool mm-common,libtool 1.5 mate-common,libtool lua5.1-policy-dev,libtool libtool-bin,libtool 2.4.2-1.8~ libtool-bin,libtool 2.4.2-1.11 libsidl-dev,libtool liblua5.2-dev,libtool liblua5.1-0-dev,libtool libltdl-dev,libtool 1.5.20 libltdl-dev,libtool 1.5.20 libltdl-dev,libtool libdune-common-dev,libtool grid-packaging-tools,libtool gnulib,libtool gnome-common,libtool gcc,libtool freehdl,libtool drizzle-plugin-dev,libtool dh-lua,libtool dh-autoreconf,libtool 2.4.2 autoconf,libtool anjuta,libtool Dependencies: 2.4.6-2 - gcc (16 (null)) c-compiler (0 (null)) cpp (0 (null)) libc6-dev (16 (null)) libc-dev (0 (null)) file (0 (null)) autotools-dev (0 (null)) libtool-doc (0 (null)) autoconf (4 2.50) automaken (0 (null)) gfortran (16 (null)) fortran95-compiler (0 (null)) gcj-jdk (0 (null)) libltdl-dev (0 (null)) autoconf (1 2.12) automake (1 1.3) libtool1.4 (0 (null)) 2.4.2-1.11 - gcc (16 (null)) c-compiler (0 (null)) cpp (0 (null)) libc6-dev (16 (null)) libc-dev (0 (null)) file (0 (null)) autotools-dev (0 (null)) libtool-doc (0 (null)) autoconf (4 2.50) automaken (0 (null)) gfortran (16 (null)) fortran95-compiler (0 (null)) gcj-jdk (0 (null)) libltdl-dev (0 (null)) autoconf (1 2.12) automake (1 1.3) libtool1.4 (0 (null)) Provides: 2.4.6-2 - 2.4.2-1.11 - Reverse Provides: 

你没有。 apt包依赖机制完全基于包名和版本。 你应该做的是find一个新的包(或build立一个),满足依赖和使用。 其他任何事情都是疯狂的。 你从php7.0-dev的回购应提供所有的依赖(或至less告诉你从哪里得到他们)。 这并不意味着它不是一个高质量的软件包源,所以你正在进入危险的领域。 如果这是你的事情,然后阅读…

如果你想用胶带把一支霰弹枪放到你的脚上,并把扳机拉回到羽毛状,你可以使用一个名为equivs的软件包来安装一个“虚拟”软件包,它本身没有任何文件,但是存在以满足依赖性。 正如我的多彩比喻所暗示的,虽然这是几乎肯定会回来的事情,将来会给你带来难以解决的问题,我认为这等于是在生产系统上进行疏忽。