1

When I run:

apt-get install php-curl

It returns:

The following packages have unmet dependencies:
 php-curl : Depends: php7.3-curl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

This doesn't make much sense (php-curl should install the newest version, which is php7.3-curl, so how can a package be its own dependency??), but anyway, I try:

apt-get install  php7.3-curl

and get

The following packages have unmet dependencies:
 php7.3-curl : Depends: libcurl3 (>= 7.44.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

To begin with I can't simply install libcurl3 because it cannot coexist with libcurl4 which a number of packages rely on already. However, it doesnt matter, because my sources.list can't even find such a package,as below:

Package libcurl3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libcurl4
  • 1
    Did you change anything in /etc/apt? – Dmitry Grigoryev Jul 10 '19 at 11:01
1

aptitude solved this problem for me by itself.

I was able to install both php7.2-curl (as the software that I needed this as a dependency for was using php7.2) and php7.3-curl through using apititude install instead of apt-get install. apititude solved the dependency conflict itself by very slightly downgrading all the other php packages for that version as such:

root@rpi_server:/etc/php# aptitude install php7.2-curl
The following NEW packages will be installed:
  php7.2-curl{b}
0 packages upgraded, 1 newly installed, 0 to remove and 873 not upgraded.
Need to get 0 B/25.8 kB of archives. After unpacking 93.2 kB will be used.
The following packages have unmet dependencies:
 php7.2-curl : Depends: libcurl3 (>= 7.44.0) which is a virtual package and is not provided by any available package

The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     php7.2-curl [Not Installed]



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

      Install the following packages:
1)      php7.2-curl [7.2.9-1+b2 (stable)]

      Downgrade the following packages:
2)      libapache2-mod-php7.2 [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
3)      php7.2-cgi [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
4)      php7.2-cli [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
5)      php7.2-common [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
6)      php7.2-gd [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
7)      php7.2-intl [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
8)      php7.2-json [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
9)      php7.2-ldap [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
10)     php7.2-mbstring [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
11)     php7.2-mysql [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
12)     php7.2-opcache [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
13)     php7.2-readline [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
14)     php7.2-xml [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
15)     php7.2-xmlrpc [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]
16)     php7.2-zip [7.2.19-1+0~20190531112637.22+stretch~1.gbp75765b (<NULL>, now) -> 7.2.9-1+b2 (stable)]

  • 1
    Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again months for months. – Ingo Dec 11 '19 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.