我无法安装用于 Apache 配置的 PHP 包

我无法安装用于 Apache 配置的 PHP 包

抱歉,这是我尝试安装以下软件包时得到的结果,如能提供任何意见我将非常感激。

yael@ypa-ubuntu-server:~$ sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php-apcu php-smbclient php7.2-ldap php-redis php7.2-gd php7.2-xml php7.2-intl php7.2-json php-imagick php7.2-mysql php7.2-cli php7.2-ldap php7.2-zip php7.2-curl
[sudo] password for yael: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libapache2-mod-php7.2 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 php-smbclient 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 php7.2-common 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 php7.2
E: Couldn't find any package by glob 'php7.2'
E: Package 'libapache2-mod-php7.2' has no installation candidate
E: Package 'php7.2-common' has no installation candidate
E: Unable to locate package php7.2-mbstring
E: Couldn't find any package by glob 'php7.2-mbstring'
E: Unable to locate package php7.2-xmlrpc
E: Couldn't find any package by glob 'php7.2-xmlrpc'
E: Unable to locate package php7.2-soap
E: Couldn't find any package by glob 'php7.2-soap'
E: Package 'php-smbclient' has no installation candidate
E: Unable to locate package php7.2-ldap
E: Couldn't find any package by glob 'php7.2-ldap'
E: Unable to locate package php7.2-gd
E: Couldn't find any package by glob 'php7.2-gd'
E: Unable to locate package php7.2-xml
E: Couldn't find any package by glob 'php7.2-xml'
E: Unable to locate package php7.2-intl
E: Couldn't find any package by glob 'php7.2-intl'
E: Unable to locate package php7.2-json
E: Couldn't find any package by glob 'php7.2-json'
E: Unable to locate package php7.2-mysql
E: Couldn't find any package by glob 'php7.2-mysql'
E: Unable to locate package php7.2-cli
E: Couldn't find any package by glob 'php7.2-cli'
E: Unable to locate package php7.2-ldap
E: Couldn't find any package by glob 'php7.2-ldap'
E: Unable to locate package php7.2-zip
E: Couldn't find any package by glob 'php7.2-zip'
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'

我尝试对其中几个使用 apt 策略 [缺失的软件包之一],得到了以下结果。

yael@ypa-ubuntu-server:~$ apt policy php7.2
N: Unable to locate package php7.2
N: Couldn't find any package by glob 'php7.2'
yael@ypa-ubuntu-server:~$ apt policy php7.2
N: Unable to locate package php7.2
N: Couldn't find any package by glob 'php7.2'
yael@ypa-ubuntu-server:~$ apt policy libapache2-mod-php7.2
libapache2-mod-php7.2:
  Installed: (none)
  Candidate: (none)
  Version table:
yael@ypa-ubuntu-server:~$ apt policy php7.2-common
php7.2-common:
  Installed: (none)
  Candidate: (none)
  Version table:
yael@ypa-ubuntu-server:~$ apt policy php7.2-mbstring
N: Unable to locate package php7.2-mbstring
N: Couldn't find any package by glob 'php7.2-mbstring'

答案1

php-smbclient最后可用正式适用于 18.04 LTS。

要在 21.04 上获得它,你必须使用 PPA

sudo apt-get install software-properties-common

sudo add-apt-repository ppa:jnweiger/php-smbclient
sudo apt-get update
sudo apt-get install php-smbclient

另请注意,建议运行 LTS 版本(如 18.04 LTS 或 20.04 LTS)以实现可靠的长期服务器安装。

相关内容