为什么不能使用ppa:ondrej?

我想在Ubuntu服务器上使用ondrej ppa来升级PHP版本。我已连接到互联网。
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php

我尝试了一下,但是出现了错误。
Cannot add PPA: 'ppa:ondrej/ubuntu/php'
'ondrej' user or team does not exist

我尝试过在命令中使用-E,但错误仍然相同。

关于代理设置,我并不是很了解。我不知道如何根据这里的答案来调整设置。

我还尝试了这个:

RUN apt-get -y install locales
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN add-apt-repository -y ppa:ondrej/php

但结果是一样的,错误无法添加ppa:ondrej
谢谢

请编辑您的问题并发布您收到的确切错误信息。 - pa4080
你使用的是哪个Ubuntu版本? - dufte
Ubuntu版本16.04 - joun
你有没有在这里检查答案(https://askubuntu.com/questions/724224/cant-add-ppa-on-ubuntu-15-10-user-or-team-does-not-exist)和(https://askubuntu.com/questions/971877/cannot-add-ppa-user-or-team-does-not-exist/1036627)?如果有的话,请编辑问题并添加你尝试过的信息。 - pLumo
2个回答

显然这是DNS问题或服务器停机,因为您发布的命令现在成功运行。
sudo add-apt-repository ppa:ondrej/php

更新后,sudo apt install php 安装了最新的 PHP 版本(目前为 7.3)。

也许问题是由以下原因之一引起的:
- 您的区域设置(语言等) - 您计算机的互联网连接 - 安装了其他 PPA 或程序包
我尝试使用一个实时的 Ubuntu 16.04.1 LTS,我可以添加仓库 ppa:ondrej/php。
有一个警告:'add-apt-repository 在非 UTF-8 区域设置下无法正常工作',并提供了一个解决方法。请参考下面的内容。
ubuntu@ubuntu:~$ sudo add-apt-repository ppa:ondrej/php
 Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions
 are included. Only Supported Versions of PHP
 (http://php.net/supported-versions.php) for Supported Ubuntu Releases
 (https://wiki.ubuntu.com/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: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
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: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see 
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

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

gpg: keyring `/tmp/tmppiurqcxa/secring.gpg' created
gpg: keyring `/tmp/tmppiurqcxa/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmppiurqcxa/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)
OK

我能够顺利通过apt,没有出现“用户或团队ondrej不存在”的错误。但是我在输入密钥后卡住了...按下回车键后,显示无效的http代理(代理地址):无效的URI,并且添加密钥失败。 - joun