无法在 ubuntu 17.10 上安装 php7.1-bcmath

无法在 ubuntu 17.10 上安装 php7.1-bcmath

我正在尝试安装 Laravel 包名称比特瓦斯但此包依赖于bcmath。每当我尝试安装时,它都会出错。我还尝试使用以下命令安装它:

sudo apt-get install php7.1-bcmath

但是每当我这样做时,我都会收到以下错误,我的 Ubuntu 是 17.10:

After this operation, 128 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-gd amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:2 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-bz2 amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:3 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-opcache amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:4 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-json amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-mcrypt amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:6 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-zip amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:7 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-curl amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:8 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-xml amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:9 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-mbstring amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:10 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-mysql amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:11 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-readline amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:12 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 libapache2-mod-php7.1 amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:13 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-cli amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:14 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-common amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:15 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-bcmath amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-gd_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-bz2_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-opcache_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-json_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mcrypt_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-zip_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-curl_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-xml_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mbstring_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mysql_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-readline_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/libapache2-mod-php7.1_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-cli_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-common_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-bcmath_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

已经运行update并且fix-missing什么也没有发生,每次我都遇到同样的错误。

答案1

# add-apt-repository ppa:ondrej/php
# apt update
# apt install php7.1-bcmath

重新启动 apache 并且一切顺利:

# service apache2 restart

答案2

您的包管理器似乎认为这些包在您使用的 ppa 中,但事实并非如此。

查看这里有精美的包装清单

看起来你的apt-get包管理想要从这个 ppa 安装所有内容。

首先要做的就是将其删除*:

sudo add-apt-repository --remove ppa:ondrej/php 

和/或

sudo add-apt-repository --remove ppa:ondrej/php

然后更新 repos

sudo apt-get update

这里是清理 apt 的好地方

sudo apt-get autoclean && sudo apt-get autoremove

然后使用以下方式安装你的软件包

sudo apt-get install php7.1-bcmath

这应该可行 - 如果没有,那么您的还有其他问题sources.list

如果你用你最喜欢的编辑器查看你的来源列表

sudo nano /etc/apt/sources.list

您应该会看到与此类似的内容。

deb http://de.archive.ubuntu.com/ubuntu artful main restricted universe multiverse
#deb-src http://de.archive.ubuntu.com/ubuntu artful main restricted universe multiverse

deb http://de.archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse
#deb-src http://de.archive.ubuntu.com/ubuntu artful-updates main restricted universe multiverse

deb http://de.archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse
#deb-src http://de.archive.ubuntu.com/ubuntu artful-security main restricted universe multiverse

deb http://de.archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse
#deb-src http://de.archive.ubuntu.com/ubuntu artful-backports main restricted universe multiverse

# deb http://archive.canonical.com/ubuntu artful partner
# deb-src http://archive.canonical.com/ubuntu artful partner

如果没有,请复制/替换此来源列表,并将 替换de为您的国家代码。还有一个相当不错的Ubuntu 维基百科条目处理存储库源。

(*)您可以随时使用以下方式重新启用它add-apt-repository ppa:ondrej/php && sudo apt-get update

答案3

安装这个: https://packages.ubuntu.com/fr/artful/amd64/php7.1-bcmath/download

添加此内容:

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

到 /etc/apt/sources.list

$ sudo apt update

$ sudo apt install php7.1-bcmath

相关内容