Unable to Add ppa in my newly installed ubuntu 16.04 LTS

38,700

Solution 1

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

Solution 2

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.

Solution 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.

Solution 4

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.

Share:
38,700

Related videos on Youtube

Akhilesh Chauhan
Author by

Akhilesh Chauhan

Updated on September 18, 2022

Comments

  • Akhilesh Chauhan
    Akhilesh Chauhan over 1 year

    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?

    • George Udosen
      George Udosen over 7 years
      please run sudo apt update && sudo apt dist-upgrade
    • Akhilesh Chauhan
      Akhilesh Chauhan over 7 years
      I have ran sudo apt update && sudo apt dist-upgrade command. even reinstalled OS.
    • sudodus
      sudodus over 7 years
      Maybe there was a (temporary?) problem with the internet connection at the Launchpad end or at your end. I checked, the ppa and the team exist at Launchpad.
    • Akhilesh Chauhan
      Akhilesh Chauhan over 7 years
      @sudodus I have another system installed with Ubuntu14.04 with same internet connection, but that works fine regarding installing ppas, but the system with 16.04 is not working fine.
  • Akhilesh Chauhan
    Akhilesh Chauhan over 7 years
    Again, today i have reinstalled with Ubuntu 15.10. and the problem still exist. didn't find anything to get out of it. $ sudo add-apt-repository ppa:noobslab/screenlets Cannot add PPA: 'ppa:~noobslab/ubuntu/screenlets'. ERROR: '~noobslab' user or team does not exist.
  • sudodus
    sudodus over 7 years
    The version 15.10 has passed end of life and is no longer supported. It is easier to get help with 16.04.1 LTS. If it is does not work with any ppa, I think there is something wrong with your installed system or with the internet connection. Please test in a live system, booted from an Ubuntu DVD disk or USB pendrive.
  • Jan
    Jan over 6 years
    I think this is very important: Add the information to pass -E to the sudo options. So sudo preserves the environment of the user (the proxies in specific). I've got this information from this stackoverflow answer. It solved the problem I had (same errors as OP).
  • Dmitrii S.
    Dmitrii S. over 6 years
  • Bo rislav
    Bo rislav over 6 years
    as I've already mentioned above, that command did not change anything in my case. I've tried it few times but no change until I did --purge of the ca-certificates.
  • Doglas
    Doglas almost 5 years
    I had a problem with NO_PUBKEY, see this link to solve -> chrisjean.com/…
  • Al-Alamin
    Al-Alamin over 4 years
    Exactly this happened to me. Thanks for you answer.
  • codelogn
    codelogn over 3 years
    I had to add our company CA certs as well. Thanks!