apt-get update& amp的问题安装卷曲

时间:2015-11-25 20:29:58

标签: linux curl ubuntu-14.04

我正在尝试为PHP安装CURL。我已经设置了一个Ubuntu 14服务器。

我正在运行

sudo apt-get update && install php5-curl

我收到以下错误

Err http://us.archive.ubuntu.com trusty InRelease

Err http://us.archive.ubuntu.com trusty-updates InRelease

Err http://us.archive.ubuntu.com trusty-backports InRelease

Err http://security.ubuntu.com trusty-security InRelease

Err http://us.archive.ubuntu.com trusty Release.gpg
Could not resolve 'host'
Err http://us.archive.ubuntu.com trusty-updates Release.gpg
Could not resolve 'host'
Err http://security.ubuntu.com trusty-security Release.gpg
Could not resolve 'host'
Err http://us.archive.ubuntu.com trusty-backports Release.gpg
Could not resolve 'host'
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/InRelease  

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease  

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease  

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease  

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Could not resolve 'host'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Could not resolve 'host'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Could not resolve 'host'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Could not resolve 'host'

W: Some index files failed to download. They have been ignored, or old ones used instead.
install: missing destination file operand after ‘php5-curl’
Try 'install --help' for more information.

sudo apt-get也有一些错误。我试图做的时候

ping us.archive.ubuntu.com

我收到了回复。

如果我尝试独立

sudo apt-get install php5-curl

我收到以下错误

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5-curl

请帮忙。

1 个答案:

答案 0 :(得分:1)

瓜拉夫 -

您遇到了apt-get update命令的问题,随后在安装php5-curl软件包时出现问题。

你说你可以ping us.archive.ubuntu.com,所以域名解析正在发生,但它不适用于apt-get。 Apt-get在某些网络上遇到过很多IPv6问题。尝试使用IPv4运行更新:

apt-get -o Acquire::ForceIPv4=true update

如果可行,您可以通过在/etc/apt/apt.conf.d/文件夹中创建一个文件来永久禁用IPv6(它可以命名为任何内容,例如99force-ipv4),其中包含以下行:

Acquire::ForceIPv4 "true";