【问题标题】:E: Unable to locate package php7.2-bcmathE: 找不到包 php7.2-bcmath
【发布时间】:2020-03-30 02:52:08
【问题描述】:

我正在尝试在 Ubuntu 14.4 上安装包 php7.2-bcmath

sudo apt-get install php7.2-bcmath

但我不断收到此错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.2-bcmath
E: Couldn't find any package by regex 'php7.2-bcmath'

我已经尝试过这些选项:

sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2-bcmath

将此添加到 /etc/apt/sources.list:

deb http://security.ubuntu.com/ubuntu artful-security main universe

没有任何效果!

请帮忙

【问题讨论】:

  • 你检查phpinfo()是否已经存在?
  • 是的。它不存在。
  • sudo apt-get install php-bcmath 能得到什么?
  • @NigelRen 同样的结果。 E: 找不到包 php-bcmath
  • 顺便说一句:这是一个重复的问题,也发布在这里:askubuntu.com/questions/1193954/… 我敢肯定,askubuntu 是更好的地方,因为这个主题与编程无关。

标签: php ubuntu ubuntu-14.04 apt-get php-7.2


【解决方案1】:

您应该检查哪个 PHP 版本可用,以及您是否解决了正确的包名称。

用途:

apt-cache search php

检查 PHP7.2 和所有扩展是否在您的环境中可用。

通过搜索所有可用的包来确定 bcmath 包的正确包名:

apt-cache search php | grep bcmath

如果您看到 php7.2 的 bcmath 包,请使用此名称和 sudo apt-get install .... 语法。

【讨论】:

  • 确保您的搜索不区分大小写。使用grep -i bcmath。如果包没有在apt-cache search php 中显示,那么你知道,这个包在你的存储库中不可用。
  • 这个包存在。但是,它不可用
  • 您只能安装在您的 apt 环境中显示的软件包。如果未显示(如您在评论中所写),则不适用于您的配置。
猜你喜欢
  • 2021-09-01
  • 2021-08-25
  • 2021-09-01
  • 2018-05-02
  • 2013-01-20
  • 1970-01-01
  • 1970-01-01
  • 2015-05-10
  • 1970-01-01
相关资源
最近更新 更多