请帮助设置安装 php7.0 和相关包(其中一些不是稳定版本)的首选项。
我有操作系统 Debian 8。
我设置了以下软件包的源列表etc\apt\sources.list.d\
:
security.list
deb http://security.debian.org/ stable/updates main contrib non-free
deb http://security.debian.org/ testing/updates main contrib non-free
stable.list
deb http://ftp.de.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.de.debian.org/debian/ stable main contrib non-free
testing.list
deb http://ftp.de.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.de.debian.org/debian/ testing main contrib non-free
unstable.list
deb http://ftp.de.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.de.debian.org/debian/ unstable main contrib non-free
我为以下软件包设置了一些首选项文件etc\apt\preferences.d\
:
security.pref
Package: *
Pin: release l=Debian-Security
Pin-Priority: 1000
stable.pref
Package: *
Pin: release a=stable
Pin-Priority: 900
testing.pref
Package: *
Pin: release a=testing
Pin-Priority: 750
unstable.pref
Package: *
Pin: release a=unstable
Pin-Priority: 50
我创建了文件99default-release
内容etc\apt\apt.conf.d\
:
APT::Default-Release "stable";
最后,当我运行安装 php7.0 的命令时出现以下错误:
root@machie:/etc# apt-get install php7.0
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 : Depends: libapache2-mod-php7.0 but it is not going to be installed or
php7.0-fpm but it is not going to be installed or
php7.0-cgi but it is not going to be installed
W: No priority (or zero) specified for pin
E: Unable to correct problems, you have held broken packages.
PS 在没有源、首选项和 apt.conf 文件的情况下,php7.0 已从“”repo 成功安装deb http://packages.dotdeb.org jessie all
。但我希望可以设置首选项。
答案1
我刚刚http://packages.dotdeb.org
从 sources.list 中删除了 repo。现在我可以通过执行命令从 debian repo 安装测试版本:
sudo apt-get install -f -y -t testing php7.0 php7.0-curl php7.0-cli php7.0-gd php7.0-xml php7.0-mbstring php-xdebug
以及所有依赖项(apache2 等)
要更新测试包,请运行命令:
apt-get install `apt-show-versions -u -b | grep testing`
要将任何软件包降级到稳定版本,请创建etc\apt\preferences.d\
包含以下内容的文件:
Package: <package_name_here>
Pin: release a=testing
Priority: 1001
然后运行apt-get update