I am using Ubuntu 14.04 with its default PHP (version 5.5.9).

If I upgrade to Ubuntu 16.04, the PHP will be also upgraded to version 7 or it will stay as is? I know that the old PHP version was removed from Ubuntu 16.04 but this is the exact version I need.

3 Answers 3


If you want to hold back a package version while upgrading, use

echo "package hold" | sudo dpkg --set-selections

to remove the hold back and upgrade the package, use

echo "package install" | sudo dpkg --set-selections


To hold sudo aptitude hold package_name

To unhold sudo aptitude unhold package_name

Here, replace 'package' with the exact package name. Hope this helps


The update process should be replacing php5 with php7.

Assuming you're running a production service, you may want to check your application against php7 beforehand, on a separate system.


I've never perform an upgrade release so I don't know much about what it will do and will the packages upgraded to stable version.

But AFAIK the upgrade process should upgrade additional package as well, so yeah it seems you'll have to work with PHP7 while you need PHP5 on 16.04 release.

There are several ways to downgrade PHP7 to PHP5 in xenial.

  • Install PHP 5.6 via Third Party Repository, this method described nicely in this answer. (EASIER)
  • Apply Trusty (14.04) repository, then install PHP5 from trusty repository.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .