【问题标题】:Couldn't upgrade PHP to 7.3 because of no matching package is available由于没有可用的匹配包,无法将 PHP 升级到 7.3
【发布时间】:2021-06-09 21:12:32
【问题描述】:

我无法在 ubuntu 16.04 上从 7.2 升级到 php7.3,我运行以下命令:

sudo apt-get install python-software-properties
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.3

出现以下输出:

Building dependency tree       
Reading state information... Done
Note, selecting 'php7.3-mongodb' for regex 'php7.3'
Note, selecting 'php7.3-memcached' for regex 'php7.3'
Note, selecting 'php7.3-msgpack' for regex 'php7.3'
Note, selecting 'php7.3-igbinary' for regex 'php7.3'
Note, selecting 'php7.3-uploadprogress' for regex 'php7.3'
Note, selecting 'php-uploadprogress' instead of 'php7.3-uploadprogress'
php7.3-msgpack is already the newest version (2.1.1+0.5.7-2+ubuntu16.04.1+deb.sury.org+4).
php7.3-mongodb is already the newest version (1.8.1-2+ubuntu16.04.1+deb.sury.org+4).
php7.3-memcached is already the newest version (3.1.5+2.2.0-4+ubuntu16.04.1+deb.sury.org+4).
php-uploadprogress is already the newest version (1.0.3.1-4-g95d8a0f-5+ubuntu16.04.1+deb.sury.org+10).
php7.3-igbinary is already the newest version (3.1.6+2.0.8-2+ubuntu16.04.1+deb.sury.org+4).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

而 PHP -v 还是旧版本

【问题讨论】:

  • 您可能仍然安装了 7.2,并且替代品仍然指向它。运行update-alternatives --list php 以查看已安装的内容。然后删除 7.2 或运行 update-alternatives--set 以选择您喜欢的默认值。
  • 我仍然安装了 php7.2,但系统中还没有安装 php7.3,我无法安装它,这就是问题,尽管找到了 repo ppa:ondrej/php 并且更新
  • 是什么让你觉得 7.3 还没有安装?您的输出中没有错误。它告诉您这些软件包没有安装,因为它们已经存在。
  • 当我尝试安装任何 php 包例如 php7.3-cli 时,我得到:E: Couldn't find any package by glob 'php7.3-cli' E: Couldn't find any package by regex 'php7.3-cli'
  • 嗯,看起来可能 ondrej 放弃了对 16.04 的支持,可能是因为它现在已经结束了支持?我认为这些软件包应该仍然可用,奇怪。

标签: php ubuntu-16.04


【解决方案1】:

Ondřej 几天前有removed support for 16.04

到目前为止,Ubuntu 16.04 LTS (Xenial) 的所有软件包都已从存储库中删除。

这解释了它上周对您来说还可以,但今天却不行。

【讨论】:

  • 该存储库是否仍可用于 ubuntu 18 或 ubuntu 20?
  • 我相信是这样——公告只提到了 16.04 并且其他 repos 的 repo 文件不是空的。 (虽然我最近没有真正尝试过安装。)
猜你喜欢
  • 2021-03-04
  • 2020-04-01
  • 1970-01-01
  • 2015-09-23
  • 2020-01-23
  • 2021-11-20
  • 2020-10-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多