3

I am trying to install ppa:ondrej/php on Ubuntu 16.04

When I enter the command:

sudo add-apt-repository ppa:ondrej/php

It gives me this message:

Cannot add PPA: 'ppa:~ondrej/ubuntu/php'.
ERROR: '~ondrej' user or team does not exist.

Error

Even I am not able to install any PPA. How do I proceed?

Byte Commander
  • 110,243

7 Answers7

7

A bit late but someone might find it helpful: I had this problem when I set HTTP_PROXY= but forgot to set HTTPS_PROXY=.

Eliah Kagan
  • 119,640
3

I tested in a live Ubuntu 16.04.1 LTS and I get ppa:ondrej/php without problems.

But there was a warning, that might explain your problem: "add -apt-repository is broken with non-UTF-8 locales, see github.com/oerdnj/deb.sury.org/issues/56 for workaround"

[my comment: Scroll and you will see the following code, that you can try.]

apt-get update &&
apt-get install -y language-pack-en-base &&
export LC_ALL=en_US.UTF-8 &&
export LANG=en_US.UTF-8 &&
apt-get install -y software-properties-common &&
add-apt-repository -y ppa:ondrej/php5-5.6 &&
add-apt-repository -y ppa:ondrej/mariadb-10.0 && 
apt-get update && 
apt-get -y upgrade

If that does not work, read the link carefully and look for other tips and tricks.

sudodus
  • 47,684
3

I had a similar problem, albeit with 17.04, but eventually determined it was actually a CA certificate problem.
SSL Certificate error when adding PPA has some solutions to this type of problem.

In my case I eventually determined my company had recently switched to an SSL inspect scheme for all external web traffic, and they were were Man-in-the-middleing all https traffic. They did this by replacing all external server certificates with internally generated ones signed by an internal root signing authority. For machines that had that internal root certificate already populated it was fine working fine, but since I was doing a fresh install I had to manually add the root signing authorities to my system's ca certificates.

mtalexan
  • 272
2

This is the only thing that worked for me:

Reinstall certificates

sudo apt-get install --reinstall ca-certificates

And if you're behind a proxy, set the proxy.

Installing the repo manually did not work, but reinstalling the certs did.

Jason
  • 121
2

I have the same problem but with elementary os based on ubuntu 16.04. The problem comes after installing some certificates and did not resolve when I have removed the certificates even with sudo apt-get install --reinstall ca-certificates or sudo dpkg-reconfigure ca-certificates . The solution I found was to completely remove the ca-certificates and install it again instead of using --reinstall .

sudo apt remove --purge ca-certificates
sudo apt autoremove
sudo apt install ca-certificates

and because the autoremove removed software-properties-common I have to install it again by typing

sudo apt install software-properties-common

After all these steps I can add repositories, use git pull and sudo apt update without any problems.

Bo rislav
  • 158
0

actually, you may have problems with config proxy. Try this one:

unset http_proxy
unset ftp_proxy
unset https_proxy

Check they have been removed by:

env | grep -i proxy

Now try add-apt-repository

0

I had this problem and it was because DNS was not working.

Fixed with:

echo "" >> "/etc/resolv.conf"
echo "nameserver 8.8.8.8" >> "/etc/resolv.conf"
echo "nameserver 1.1.1.1" >> "/etc/resolv.conf"
echo "nameserver 2001:4860:4860::8888" >> "/etc/resolv.conf"