Ubuntu 18.04升级后无法安装php7.2-curl

Arn*_*i J 26 php apt php-curl ubuntu-18.04

从今天的16.04升级到18.04使用 do-release-upgrade -d

在升级过程中,我被告知将删除一些软件包,其中包括:

删除:libperl5.22 lxc-common perl-modules-5.22 php-imagick
php7.1-curl php7.2-curl python3-certbot-nginx

我可以毫无问题地重新安装imagick和certbot,但如果我尝试安装php7.2-curl,我会收到消息:

# apt install php7.2-curl -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2-curl : Depends: php7.2-common (= 7.2.3-1ubuntu1) but 7.2.4-1+ubuntu16.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

我该如何纠正这种情况?

小智 55

这可以为您节省:

sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.2-fpm php7.2-gd php7.2-curl php7.2-mysql php7.2-dev php7.2-cli php7.2-common php7.2-mbstring php7.2-intl php7.2-zip php7.2-bcmath
Run Code Online (Sandbox Code Playgroud)

然后 sudo service apache2 restart

  • 这成功了。我的 PPA 仍然存在,但用于 Bionic。所以重新添加我的 PPA 并进行 apt 更新/升级,然后安装 php7.2-curl 让我回到了一个良好的状态:) (2认同)