我需要安装一些包来为在 VB 中运行的 Debian 9 操作系统中的项目准备工作区。我有指令:
----------------------------------------------------------------------
The following Debian 8 packages are required to run [X-Product]:
sudo apt-get install exim4 ntp pwgen curl php5-dev php-pear pkg-config nmap libzmq3 libzmq3-dev libapache2-mod-php5 apache2 percona-server-server-5.6 php5-cli php5-mysql php5-curl php5-intl daemontools-run oracle-java8-installer ant ruby-compass libtool-bin
----------------------------------------------------------------------
当我运行命令时,我得到以下终端堆栈,
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-curl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Unable to locate package php5-dev
E: Unable to locate package libzmq3
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-mysql' has no installation candidate
E: Package 'php5-curl' has no installation candidate
E: Unable to locate package php5-intl
我在互联网上做了一些研究,接下来做了以下,
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
它对我一点帮助都没有。我需要什么来解决这个问题?如果你问,我对 Debian 知之甚少
注意:我按照提供的答案中的说明进行操作,问题仍然没有解决,因为我看不到 php version
当我运行命令时
sudo apt-get install php5.6
它在终端打印,
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php5.6-json' for regex 'php5.6'
Note, selecting 'php5.6-common' for regex 'php5.6'
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
要查找 PHP
版本,
sudo php -v
它在终端打印,
sudo: php: command not found
更多信息,比如我是否运行它
sudo apt-get install php5-dev
我收到错误
E: 无法定位包 php5-dev
但是,命令
sudo apt-get install php-dev
成功
命令
dpkg -l | grep php| awk '{print $2}' |tr "\n"""
返回值,
这是否意味着我安装了 php7 并且阻止了其他操作?
dh-php php-cli php-common php-dev php-gd php-pear php-xml php7.0-cli php7.0-common php7.0-dev php7.0-gd php7.0-json php7.0-opcache php7.0-readline php7.0-xml pkg-php-tools
最佳答案
打开终端并运行以下命令:
apt-get install apt-transport-https lsb-release ca-certificates
获取 gpg key :
wget -O/etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
将新存储库添加到您的源:
echo "deb https://packages.sury.org/php/$(lsb_release -sc) main">/etc/apt/sources.list.d/php.list
安装PHP5.6
apt-get 更新
apt-get 安装 php5.6
更新
echo "deb https://packages.sury.org/php/$(lsb_release -sc) main">/etc/apt/sources.list.d/php.list 行的解决方法
:
运行它,并记下输出:
lsb_release -sc
在您选择的编辑器中打开 /etc/apt/sources.list.d/php.list
并将其附加到底部:
deb https://packages.sury.org/php/OUTPUT_FROM_LSC_COMMAND main
关于php - Derby 安 9 : the php5 packages is not installed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47691057/