Cannot install PHP7.2-dev on Ubuntu 18 due to unmet dependencies
The advice from user535733 in the comments is very vague and actually not 100% possible in this case since it would mean un-installing libpcre3
. Doing that would remove a ton of your packages.
The key to this was in this question where the user was unable to install libpcre3-dev
(which is one of the dependencies you are having trouble installing).
I am going to assume that since you have a later version of libpcre3-dev
than intended, you must have had the third party (ondrej) ppa previously.
So what you need to do is not uninstall the non-Ubuntu packages, but downgrade the php7.2-dev dependencies.
In my case, doing the following fixed the issue after removing the third party PPA:
sudo apt install libpcre3=2:8.39-9 libpcre3-dev=2:8.39-9
sudo apt install libssl1.1=1.1.0g-2ubuntu4.1 libssl-dev=1.1.0g-2ubuntu4.1
Why does this need to happen?
You likely had PHP 7.2.7 from the ondrej repos but now have 7.2.5 from the official repos. However, libpcre3 and libssl are probably still on later versions from the other repo.
So those commands should fix the issue for you and you should be able to successfully install php7.2-dev
.