Cannot add ppa: ppa:ondrej ubuntu/php

I'm using Ubuntu 21.10 [impish flavor] and have just installed PHP 8.1 using Ondrej's PPA.

As recommended, I'd also like to use Ondrej's Nginx PPA to get the latest mainline version and benefit from Brotli support and TLS 1.3 among other improvements.

It seems this PPA isn't available for the impish flavor though?

#:/etc/apt# add-apt-repository ppa:ondrej/nginx-mainline
[...]
Err:8 //ppa.launchpad.net/ondrej/nginx-mainline/ubuntu impish Release
  404  Not Found

Am I missing something here? Should I use the hirsute package instead as suggested on their Issue tracker?

While the answer of @tanveerahmaddar anycodings_ubuntu provides crucial information, here is anycodings_ubuntu the correct way to install the PHP 5.6 anycodings_ubuntu on Ubuntu 12.04:

Important: If you plan to use PHP5.6 in anycodings_ubuntu websites [which you probably wish to], anycodings_ubuntu you have to upgrade to Apache 2.4, which anycodings_ubuntu does not ship with Ubuntu 12.04 [will anycodings_ubuntu cover the upgrade of Apache below]

Step 1: Check versions

# check PHP version
php -v
# check Apache version
apache2 -v

If your Apache version is 2.2, follow anycodings_ubuntu Step 2; if version is 2.4, skip to Step anycodings_ubuntu 3

Step 2: Add PHP5.6+ repository and anycodings_ubuntu update package list

add-apt-repository ppa:ondrej/apache2
apt-get update
apt-get upgrade

This step will upgrade Apache from 2.2 anycodings_ubuntu to 2.4. Re-configure your Apache if anycodings_ubuntu needed. Backup your existing Apache anycodings_ubuntu configurations, enabled sites and mods. anycodings_ubuntu You might need to re-install / upgrade anycodings_ubuntu some of the mods.

Step 3: Add PHP5.6+ Repository

add-apt-repository ppa:ondrej/php
apt-get update

Step 4: Install PHP 5.6

apt-get install -y php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip libapache2-mod-php5.6

This will install PHP 5.6 and some anycodings_ubuntu common packages such as cURL anycodings_ubuntu [php5.6-curl] and GD [lib5.6-gd], as anycodings_ubuntu well as enable PHP 5.6 in Apache 2.4 anycodings_ubuntu [libapache2-mod-php5.6].

Apache will be restarted during the anycodings_ubuntu process.

That's all steps you have to do.

Hint: If you want to upgrade to PHP 7 anycodings_ubuntu instead [off-topic], just issue the anycodings_ubuntu following command after Step 3 [skip anycodings_ubuntu Step 4]:

apt-get dist-upgrade

Final words: Not recommend to upgrade to anycodings_ubuntu PHP 5.6 in Ubuntu 12.04, as it involves anycodings_ubuntu upgrading Apache to 2.4. Ubuntu 14.04 anycodings_ubuntu comes with Apache 2.4, which is a lot anycodings_ubuntu easier to upgrade PHP 5.6.

A regular reader of It’s FOSS, Chetan Jain contacted me today with this question: How can I fix “Cannot add PPA” error in Ubuntu. Chetan was trying to install TLP [power management tool to reduce overheting] and encountered this error:

[email protected]:~$ sudo add-apt-repository ppa:linrunner/tlp
Cannot add PPA: ‘ppa:linrunner/tlp’.
Please check that the PPA name or format is correct.

If you encounter similar error while adding a PPA in Ubuntu or Linux Mint, don’t worry. It’s one of the [less] common issue with PPA and can be solved easily.

Highly Recommended

I highly recommend reading this detailed article on what is PPA, why is it used, how it works. This will give you a better understanding of PPA.

There can be mainly two reasons behind this kind of error. Either the CA certificates on your system are broken or there is a proxy set up in your network.

Let’s first try to reinstall the CA certificates:

sudo apt-get install --reinstall ca-certificates

If the above command doesn’t work, perhaps there is proxy settings involved. To pass proxy settings to sudo, use it with E option in the following manner:

sudo -E add-apt-repository ppa:linrunner/tlp

This will get the PPA working. Chetan’s issue was solved with the second solution. I hope this quick tip help you as well to get rid of the PPA error. Any questions or suggestions are always welcomed.

Creator of It's FOSS. An ardent Linux user & open source promoter. Huge fan of classic detective mysteries ranging from Agatha Christie and Sherlock Holmes to Detective Columbo & Ellery Queen. Also a movie buff with a soft corner for film noir.

Bài mới nhất

Chủ Đề