无法在 Ubuntu 19.04 中安装 php7.1-soap [英] Unable to install php7.1-soap in Ubuntu 19.04

查看:17
本文介绍了无法在 Ubuntu 19.04 中安装 php7.1-soap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 上的 Apache 服务器上运行 PHP 7.2,我需要添加 PHP SoapClient.但是,当我尝试使用 apt-get 安装它时,出现以下错误:

以下包有未满足的依赖项:php7.2-soap : 取决于: php7.2-common (= 7.2.24-0ubuntu0.19.04.2) 但要安装 7.2.26-1+ubuntu19.04.1+deb.sury.org+1E:无法纠正问题,您持有破损的包裹.

在重新尝试之前,我已经尝试了以下操作:

sudo apt-get 更新sudo apt-get clean &&sudo apt-get 更新sudo apt-get 升级sudo apt-get upgrade-distsudo apt-get -f 安装须藤 dpkg --configure -a

如果有帮助,当我运行 uname -r 时,输出是5.0.0-37-generic

提前致谢!

解决方案

在解决这个问题的 looooong 时间之后,我终于解决了这个问题并找到了解决方案 :)

问题似乎是我使用的是 ppa:ondrej/apache2 PPA,它安装了最新版本的 PHP 软件包选择,在撰写本文时使用的是 PHP7.2.27.据我所知,php7.2-soap 包的最新版本是针对 php7.2.24 的,这意味着 PPA 提供的 php7.2-common 包存在未满足的依赖项.

因此,解决方案是删除 PPA 并降级 PHP 包.以下是可能遇到类似问题的可怜人的分步指南:

首先,如果还没有安装,安装aptitude sudo apt-get install aptitude

接下来,安装 ppa-purge:

mkdir ppa-purge &&cd ppa-purge &&wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb &&wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb &&须藤 dpkg -i ./*.deb

(我在我的用户文件夹中运行它,即 ~/

然后我使用以下命令删除 PPA:

sudo ppa-purge ppa:ondrej/apache2sudo add-apt-repository --remove ppa:ondrej/apache2sudo apt-get 自动清理

现在我们需要降级依赖项.首先,我确定了我需要哪个版本.导致未满足依赖项的包是 php7.2-common,所以我运行 sudo apt list -a php7.2-common.我选择了与原始错误消息匹配的版本,在本例中为 7.2.24-0ubuntu0.19.04.2.

因此,您可以通过在包后面加上 = 和版本号来安装特定版本.如果你和我一样,正在一个实时服务器上工作,我将在接下来的命令中大声喊出你将要写的下一个命令:

不要使用 -y 标签!!

当它询问您是否要继续时,请选择否"!!

如果您执行任何这些操作,它将自动删除 php7.2-common 的所有依赖项,并且 PHP 将停止在您的站点上工作.

为了确定我们需要与 php7.2-common 一起更新哪些依赖项,我运行了 sudo apt-get install php7.2-common=7.2.24-0ubuntu0.19.04.2.然后它向我展示了它也会删除的其他软件包的列表.我复制了这些依赖项,然后选择n"取消安装.

接下来,我将复制的列表放入文本编辑器并使用它创建以下脚本:

sudo apt-get install php7.2-common=7.2.24-0ubuntu0.19.04.2 \libapache2-mod-php7.2=7.2.24-0ubuntu0.19.04.2 \php7.2=7.2.24-0ubuntu0.19.04.2 \php7.2-bcmath=7.2.24-0ubuntu0.19.04.2 \php7.2-bz2=7.2.24-0ubuntu0.19.04.2 \php7.2-cgi=7.2.24-0ubuntu0.19.04.2 \php7.2-cli=7.2.24-0ubuntu0.19.04.2 \php7.2-curl=7.2.24-0ubuntu0.19.04.2 \php7.2-dev=7.2.24-0ubuntu0.19.04.2 \php7.2-enchant=7.2.24-0ubuntu0.19.04.2 \php7.2-fpm=7.2.24-0ubuntu0.19.04.2 \php7.2-gd=7.2.24-0ubuntu0.19.04.2 \php7.2-imap=7.2.24-0ubuntu0.19.04.2 \php7.2-intl=7.2.24-0ubuntu0.19.04.2 \php7.2-json=7.2.24-0ubuntu0.19.04.2 \php7.2-ldap=7.2.24-0ubuntu0.19.04.2 \php7.2-mbstring=7.2.24-0ubuntu0.19.04.2 \php7.2-mysql=7.2.24-0ubuntu0.19.04.2 \php7.2-odbc=7.2.24-0ubuntu0.19.04.2 \php7.2-opcache=7.2.24-0ubuntu0.19.04.2 \php7.2-pspell=7.2.24-0ubuntu0.19.04.2 \php7.2-readline=7.2.24-0ubuntu0.19.04.2 \php7.2-tidy=7.2.24-0ubuntu0.19.04.2 \php7.2-xml=7.2.24-0ubuntu0.19.04.2 \php7.2-xmlrpc=7.2.24-0ubuntu0.19.04.2 \php7.2-zip=7.2.24-0ubuntu0.19.04.2

最后,我运行了这个命令.它没有警告我删除这些软件包,而是警告我这些软件包将被降级",这很好.我按 Y 并重新安装了所有软件包和中提琴!然后我就可以安装 php7.2-soap :)

请参阅我认为为此找到解决方案的这些链接:

I am running PHP 7.2 on an Apache server on Ubuntu, and I need to add the PHP SoapClient. However, when I try to install it using apt-get, I get the following error:

The following packages have unmet dependencies:
 php7.2-soap : Depends: php7.2-common (= 7.2.24-0ubuntu0.19.04.2) but 7.2.26-1+ubuntu19.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.

I've tried the following before reattempting:

sudo apt-get update
sudo apt-get clean && sudo apt-get update
sudo apt-get upgrade
sudo apt-get upgrade-dist
sudo apt-get -f install
sudo dpkg --configure -a

If it helps, when I run uname -r the output is 5.0.0-37-generic

Thanks in advance!

解决方案

After a looooong time tackling this issue I finally got my head around it and found a solution :)

It seems the issue is I was using the ppa:ondrej/apache2 PPA which was installing the latest version of a selection of PHP packages, which at the time of writing is using PHP7.2.27. As far as I can tell, the most up-to-date version of the php7.2-soap package is for php7.2.24, meaning there is an unmet dependency for the php7.2-common package provided by the PPA.

So, the solution was to remove the PPA and downgrade the PHP packages. Here's a step by step for any poor souls who might encounter a similar issue:

First, if not already installed, install aptitude sudo apt-get install aptitude

Next, install ppa-purge:

mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && sudo dpkg -i ./*.deb 

(I ran this in my user folder, i.e. ~/

Then I remove the PPA with the following commands:

sudo ppa-purge ppa:ondrej/apache2
sudo add-apt-repository --remove ppa:ondrej/apache2
sudo apt-get autoclean

Now we need to downgrade the dependencies. First I determined which version I needed. The package that was causing the unmet dependency was php7.2-common, so I ran sudo apt list -a php7.2-common. I chose the version which matched the original error message, in this case, 7.2.24-0ubuntu0.19.04.2.

So you are able to install a specific version by following the package with a = then a version number. If you, like me, are working on a live server, I'm going to shout this next bit about the next command you will write:

DO NOT USE THE -y TAG!!

CHOOSE "NO" WHEN IT ASKS YOU IF YOU WANT TO CONTINUE!!

If you do any of these, it will automatically remove any dependencies for php7.2-common and the PHP stop working on your site.

To determine which dependencies we need to update along with php7.2-common, I ran sudo apt-get install php7.2-common=7.2.24-0ubuntu0.19.04.2. It then showed me a list of other packages it would remove as well. I copied these dependencies then chose 'n' to cancel the install.

Next, I put the copied list into a text editor and used it to create the following script:

sudo apt-get install php7.2-common=7.2.24-0ubuntu0.19.04.2 \
libapache2-mod-php7.2=7.2.24-0ubuntu0.19.04.2 \
php7.2=7.2.24-0ubuntu0.19.04.2 \
php7.2-bcmath=7.2.24-0ubuntu0.19.04.2 \
php7.2-bz2=7.2.24-0ubuntu0.19.04.2 \
php7.2-cgi=7.2.24-0ubuntu0.19.04.2 \
php7.2-cli=7.2.24-0ubuntu0.19.04.2 \
php7.2-curl=7.2.24-0ubuntu0.19.04.2 \
php7.2-dev=7.2.24-0ubuntu0.19.04.2 \
php7.2-enchant=7.2.24-0ubuntu0.19.04.2 \
php7.2-fpm=7.2.24-0ubuntu0.19.04.2 \
php7.2-gd=7.2.24-0ubuntu0.19.04.2 \
php7.2-imap=7.2.24-0ubuntu0.19.04.2 \
php7.2-intl=7.2.24-0ubuntu0.19.04.2 \
php7.2-json=7.2.24-0ubuntu0.19.04.2 \
php7.2-ldap=7.2.24-0ubuntu0.19.04.2 \
php7.2-mbstring=7.2.24-0ubuntu0.19.04.2 \
php7.2-mysql=7.2.24-0ubuntu0.19.04.2 \
php7.2-odbc=7.2.24-0ubuntu0.19.04.2 \
php7.2-opcache=7.2.24-0ubuntu0.19.04.2 \
php7.2-pspell=7.2.24-0ubuntu0.19.04.2 \
php7.2-readline=7.2.24-0ubuntu0.19.04.2 \
php7.2-tidy=7.2.24-0ubuntu0.19.04.2 \
php7.2-xml=7.2.24-0ubuntu0.19.04.2 \
php7.2-xmlrpc=7.2.24-0ubuntu0.19.04.2 \
php7.2-zip=7.2.24-0ubuntu0.19.04.2

Finally, I ran this command. Instead of warning me about removing the packages, it warned me that these packages would be "downgraded", which is fine. I pressed Y and it reinstalled all the packages and viola! I was then able to install php7.2-soap :)

See these links which I credit to finding a solution for this:

这篇关于无法在 Ubuntu 19.04 中安装 php7.1-soap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆