I've recently upgraded a couple of VPS from 14.04 LTS to 16.04 LTS. The upgrade has apparently ended successfully.

Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.9.36-x86_64-linode85 x86_64)

I've now tried to install php7.0-dev, but it seems like my apt-get tries to install old packages thinking they're at the newest version:

The following packages have unmet dependencies: php7.0-dev : 
Depends: libpcre3-dev but it is not going to be installed
          Depends: php7.0-common (= 7.0.22-0ubuntu0.16.04.1) but 7.0.23-1+ubuntu14.04.1+deb.sury.org+1 is to be installed
          Recommends: dh-php but it is not going to be installed 
E: Unable to correct problems, you have held broken packages.

I have tried to run apt-get update/upgrade/dist-upgrade already. The sources.list file refers to xenial.

What is the problem here? How to download new packages?

  • It looks like some newer php packages were installed from a different source. Probably a question for support at your VPS hosting service. – dobey Oct 4 '17 at 20:30

It was actually only a problem with PHP 7.0 and all its dependencies. I had to add ppa to install it on 14.04, they were removed with the upgrade, but their version was still newer than 16.04 official repositories and this was preventing any kind of install related to PHP 7.0.

I have removed the php7.0-common package and reinstalled all from scratch, including extensions etc. It looks to be working fine now.

Unfortunately I have not found a way to downgrade the packages, as they were depending one each other, so the version downgrade was failing for anything I tried (php7.0, php7.0-common, etc.)

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.