我想在Linode Server 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
输出 cat /etc/apt/sources.list.d / * enter image description here
答案 0 :(得分:0)
在debian伸展时,deb https://packages.sury.org/php/ stretch main
应仅包含以下行:
#
您需要取消注释以上行(删除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
)并禁用其他ppa(您不需要它们)。
启用时,依赖性问题来自artuful ppa。要解决您的问题,请打开终端然后运行以下命令:
update-alternatives --config php
使用private List<Cow> cows;
在php版本之间切换。
答案 1 :(得分:0)
问题是http://ppa.launchpad.net/ondrej/php/ubuntu包含冲突版本的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
我希望这会有所帮助。