无法在Ubuntu 16.04上安装php7.2-连接到ppa.launchpad.net 91.189.95.83超时

时间:2019-06-19 07:32:43

标签: php installation ubuntu-16.04 apt-get launchpad

我已成功将我的AWS EC2实例升级到Ubuntu16.04,并希望从ondrej / php安装php7.2

问题是,过去2个小时我一直尝试这样做,但无济于事。我已经运行了apt-get更新,每次执行该更新时,它都无法连接到ppa.launchpad.net(91.189.95.83)。它将超时,我无法获得http://ppa.launchpad.net/ondrej/php/ubuntu的Xenial InRelease

# apt-get update
Hit:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease                    
Hit:3 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease                  
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]                                                
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease                                                         
Could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out
Fetched 109 kB in 2min 0s (909 B/s)                
Reading package lists... Done
W: Failed to fetch 
http://ppa.launchpad.net/ondrej/php/ubuntu/dists/xenial/InRelease  
Could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

我尝试wget -O / dev / null http://ppa.launchpad.net/ondrej/php/ubuntu/dists/xenial/InRelease,它可以下载它。我尝试ping 91.189.95.83,它可以正常工作。我只是无法执行apt-get更新,随后无法进行apt-get安装php7.2

有人遇到这个问题并设法解决了吗?

2 个答案:

答案 0 :(得分:0)

使用系统设置更新它> ubuntu中的软件更新,并在更新后运行命令

sudo apt-get update

答案 1 :(得分:0)

我可以通过增加超时和重试来使其正常工作:

sudo apt-get update --option Acquire :: Retries = 100 --option Acquire :: http :: Timeout =“ 60”

并将相同的选项添加到apt-get dist-upgrade

请参阅:https://github.com/travis-ci/travis-ci/issues/9112