Why can't I upgrade to PHP 7.3?

apt-get fails to install the php7.3 package:

# apt-get install php7.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.3
E: Couldn't find any package by regex 'php7.3'

I have followed these instructions including overriding locale settings during add-apt-repository and apt-get update:

 Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP ( for Supported Ubuntu Releases ( are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.

Debian oldstable and stable packages are provided as well:

You can get more information about the packages at

BUGS&FEATURES: This PPA now has a issue tracker:

1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly:

WARNING: add-apt-repository is broken with non-UTF-8 locales, see for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 More info:
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp5dog4r97/secring.gpg' created
gpg: keyring `/tmp/tmp5dog4r97/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server
gpg: /tmp/tmp5dog4r97/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

I am running Ubuntu 14.04.6 with Apache 2.4.7 and currently php 5.5.9 (which I am trying to upgrade).

What is going wrong?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Upgrade to php7.3

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y php7.3

Check php version

php -v

I hope this helps

Here if you are using ubuntu and apache this is the safest way to upgrade from 7.2 to 7.3 most if not all packages will be installed accept imagick and that can be added later.

1: sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php7.3

sudo apt-cache search php7.3 | grep php7.3

A quick one-line command to install the same packages on php7.3 as php7.2: 2: sudo apt install $(apt list --installed | grep php7.2- | cut -d’/’ -f1 | sed -e ‘s/7.2/7.3/g’)

3: sudo a2dismod php7.2 4: sudo a2enmod php7.3 exit.

If you do a search after this and find some packages are missing then just add them go back into the server, stop apache2 again and add the package then restart server. This is the friendly way to install php 7.3 with least likely errors. I have listed the source for this information at the top of this post as well I have just added the stop and start features for the server so it will be new user friendly.

sudo apt install php7.3-imagick <<<Install now

systemctl restart apache2

systemctl stop apache2


Currently, Ubuntu 14.04 is EOL (end of life), which limits updates to security patches until 2022. Many third-party repositories, including those maintained by Ondřej Surý, will discontinue updates for EOL’ed releases and instead focus on the latest–Ubuntu 18.04 is the latest LTS release.

You can verify what PHP packages are available by using apt-cache search. For example, if we wanted to verify what php7.3 packages are available, we could use the command below:

apt-cache search php7.3 | grep "php7.3" | awk '{print $1}'

If the output from the command above provides a list of PHP packages, those should be accessible and available for you to install. If the list is empty, the best option would be to migrate to Ubuntu 18.04 and install the PPA once again.