"curl : Depends: libcurl4 (= 7.61.0-1ubuntu2.2) but it is not going to be installed" on Ubuntu 18.10 with PHP 7.2.10

I am struggling with installing cURL module in Ubuntu 18.10. While upgrading from 17.10 to 18.10 cURL was removed/deleted. Now when I try to execute the command

sudo apt-get install php7.2-curl

I get this error:

The following packages have unmet dependencies:
  php7.2-curl :
  Depends: libcurl4 (>= 7.44.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo apt-get install curl

gives the error

The following packages have unmet dependencies:
  curl : Depends: libcurl4 (= 7.61.0-1ubuntu2.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Content List of my /etc/apt/sources.list.d/

output of apt-cache policy php7.2-curl curl libcurl4

Output of apt update and apt dist-upgrade

Other Software List


SIMPLE SOLUTION: (worked for me)

sudo apt remove libcurl4
sudo apt install curl

The problem: When preparing your dist-upgrade, looks like you made mistakes:

  • You failed to disable a 17.10 repository.
  • You failed to uninstall non-Ubuntu software, and did not disable those PPAs.

Now you are stuck with a mixture of wrong-version packages which are (understandably) blocking apt. We would usually call this a partial or incomplete upgrade. All this information is from the output you provided.

The solution: You have two options:

  1. Clean up the mess.

    • Uninstall all PPA and other non-Ubuntu software, and disable the sources they came from.
    • Disable the 17.10 repo.
    • Then run an apt update and then an apt dist-upgrade to get you as close to stock 18.10 as possible.
    • Then, one by one, start adding back non-Ubuntu sources and software.
  2. If you don't know how to do #1, then preserve your data and do a clean-install of 18.10.


After I removed the package libcurl4, my apache stopped starting and shows error 502. Be careful when removing this package.