apt-get update 和安装 Curl 的问题



我正在尝试为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

请帮忙。

Guarav-

您在使用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/文件夹中创建一个文件(可以命名为任何名称,例如99force-ipv4)来永久禁用IPv6,其中包含以下行:

Acquire::ForceIPv4 "true";

最新更新