Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在Linode服务器Debian 9上安装php5.6的GD库时出现依赖关系中断_Linux_Debian_Gd_Php 5.6_Linode - Fatal编程技术网

Linux 在Linode服务器Debian 9上安装php5.6的GD库时出现依赖关系中断

Linux 在Linode服务器Debian 9上安装php5.6的GD库时出现依赖关系中断,linux,debian,gd,php-5.6,linode,Linux,Debian,Gd,Php 5.6,Linode,我想在Linode服务器Debian 9上安装php5.6的GD库 我运行apt get install php5.6-gd 输出为: php5.6-gd : Depends: libgd3 (>= 2.1.1) but it is not going to be installed 然后我尝试安装该软件包apt get install libgd3 输出为: libgd3 : Depends: libfontconfig1 (>= 2.11.94) but 2.11.0-6.7

我想在Linode服务器Debian 9上安装php5.6的GD库

我运行
apt get install php5.6-gd

输出为:

php5.6-gd : Depends: libgd3 (>= 2.1.1) but it is not going to be installed
然后我尝试安装该软件包
apt get install libgd3
输出为:

 libgd3 : Depends: libfontconfig1 (>= 2.11.94) but 2.11.0-6.7+b1 is to be installed
 Depends: libjpeg8 (>= 8c) but it is not installable
我试图通过运行命令apt get install libfontconfig1=2.11.94来安装上述版本

输出为:

Version '2.11.94' for 'libfontconfig1' was not found
我通过运行以下命令检查了libfontconfig1包的可用版本:

apt-cache policy libfontconfig1
输出为:

libfontconfig1:

 Installed: 2.11.0-6.7+b1
 Candidate: 2.11.0-6.7+b1
 Version table:
2.11.0-6.7+b1 500
       500 http://mirrors.linode.com/debian stretch/main amd64 Packages
       100 /var/lib/dpkg/status
我没有找到可用的(>=2.11.94)版本

cat/etc/apt/sources.list的输出

# deb http://mirrors.linode.com/debian/ stretch main

deb http://mirrors.linode.com/debian/ stretch main
deb-src http://mirrors.linode.com/debian/ stretch main

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

deb http://ftp.de.debian.org/debian stretch main

debian stretch上的cat/etc/apt/sources.list.d/*

输出您的
/etc/apt/sources.list.d/php.list
应仅包含以下行:

deb https://packages.sury.org/php/ stretch main
您需要取消对上述行的注释(删除
#
),并禁用其他ppa(您不需要它们)

启用时,依赖性问题来自artuful ppa。要解决问题,请打开终端,然后运行以下命令:

rm /etc/apt/sources.list.d/*
apt install apt-transport-https lsb-release ca-certificates curl
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
curl https://packages.sury.org/php/apt.gpg | apt-key add -
apt update
apt upgrade
apt dist-upgrade
apt install php5.6
使用
updatealternations--config php
在php版本之间切换。

问题在于包含冲突版本的libgd3

vagrant@localhost:~$ sudo apt-cache policy libgd3
libgd3:
  Installed: (none)
  Candidate: 2.2.5-3+ubuntu16.04.1+deb.sury.org+1
  Version table:
     2.2.5-3+ubuntu16.04.1+deb.sury.org+1 500
        500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages
     2.2.4-2+deb9u2 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
您需要从官方存储库安装以下版本:

vagrant@localhost:~$ sudo apt-get install libgd3=2.2.4-2+deb9u2

我希望这会有所帮助。

欢迎使用stackoverflow,请添加
cat/etc/apt/sources.list
cat/etc/apt/sources.list.d/*
相关的输出。此解决方案仍然适用于我