I am trying to install CURL for PHP. I have setup a Ubuntu 14 server.
I am running
sudo apt-get update && install php5-curl
I am getting the following error
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.
There are a few errors with sudo apt-get updated too. When I try to do
ping us.archive.ubuntu.com
I am getting a response.
If I try to do a standalone
sudo apt-get install php5-curl
I get the following error
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5-curl
Please help.
Guarav -
You are running into issues with the apt-get update command, and subsequently having an issue installing the php5-curl package.
You stated you are able to ping us.archive.ubuntu.com though, so domain name resolution is occurring, but it does not work with apt-get. Apt-get has a lot of problems I've experienced with IPv6 on certain networks. Try running the update with just IPv4 with this:
apt-get -o Acquire::ForceIPv4=true update
And if that works, you can disable IPv6 permanently by creating a file in the /etc/apt/apt.conf.d/ folder (it can be named anything, for example 99force-ipv4) with this line in it:
Acquire::ForceIPv4 "true";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.