2

I am trying to install / update some packages (in this case libnlopt-dev). When I type sudo apt-get update I get this:

Err:1 https://deb.opera.com/opera-stable stable InRelease
  Could not resolve host: deb.opera.com
Err:2 http://repository.spotify.com stable InRelease
  Could not resolve 'repository.spotify.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not resolve 'archive.ubuntu.com'
Err:4 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
  Could not resolve 'ppa.launchpad.net'
Err:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Could not resolve 'archive.ubuntu.com'
Err:6 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu xenial InRelease
  Could not resolve 'ppa.launchpad.net'
Err:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Could not resolve 'archive.ubuntu.com'
Err:8 http://archive.ubuntu.com/ubuntu xenial-security InRelease
  Could not resolve 'archive.ubuntu.com'
Err:9 http://dl.google.com/linux/chrome/deb stable InRelease
  Could not resolve 'dl.google.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu/dists/xenial/InRelease  Could not resolve 'ppa.launchpad.net'
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/InRelease  Could not resolve 'dl.google.com'
W: Failed to fetch https://deb.opera.com/opera-stable/dists/stable/InRelease  Could not resolve host: deb.opera.com
W: Failed to fetch http://repository.spotify.com/dists/stable/InRelease  Could not resolve 'repository.spotify.com'
W: Failed to fetch http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/dists/xenial/InRelease  Could not resolve 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

pinging, for example, archive.ubuntu.com works just fine. I'm also able to browse the internet without issues.

Here is the output of running host -v archive.ubuntu.com:

Trying "archive.ubuntu.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48628
;; flags: qr ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;archive.ubuntu.com.            IN      A

;; ANSWER SECTION:
archive.ubuntu.com.     505     IN      A       91.189.88.149

Received 52 bytes from 127.0.1.1#53 in 13 ms
Trying "archive.ubuntu.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27582
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;archive.ubuntu.com.            IN      AAAA

;; ANSWER SECTION:
archive.ubuntu.com.     600     IN      AAAA    2001:67c:1360:8001::21
archive.ubuntu.com.     600     IN      AAAA    2001:67c:1560:8001::11
archive.ubuntu.com.     600     IN      AAAA    2001:67c:1560:8001::14
archive.ubuntu.com.     600     IN      AAAA    2001:67c:1360:8001::17

;; AUTHORITY SECTION:
ubuntu.com.             352     IN      NS      ns3.p27.dynect.net.
ubuntu.com.             352     IN      NS      ns2.p27.dynect.net.
ubuntu.com.             352     IN      NS      ns1.p27.dynect.net.
ubuntu.com.             352     IN      NS      ns4.p27.dynect.net.

;; ADDITIONAL SECTION:
ns1.p27.dynect.net.     41193   IN      A       208.78.70.27
ns2.p27.dynect.net.     41193   IN      A       204.13.250.27
ns3.p27.dynect.net.     41193   IN      A       208.78.71.27
ns4.p27.dynect.net.     41193   IN      A       204.13.251.27

Received 298 bytes from 127.0.1.1#53 in 54 ms
Trying "archive.ubuntu.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21583
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;archive.ubuntu.com.            IN      MX

;; AUTHORITY SECTION:
ubuntu.com.             300     IN      SOA     ns1.canonical.com. hostmaster.canonical.com. 2016102809 10800 3600 604800 3600

Received 97 bytes from 127.0.1.1#53 in 35 ms

How can I fix this?

quant
  • 762
  • Check if you have enabled apt-proxy – Anwar Oct 28 '16 at 12:26
  • What happens if you do the sudo apt-get update immediately after the host -v? – zwets Oct 28 '16 at 12:26
  • @zwets exactly the same thing – quant Oct 28 '16 at 12:27
  • @Anwar how do I do that? grep -ri proxy /etc/apt/apt.conf.d/* returns nothing, if that helps. – quant Oct 28 '16 at 12:28
  • @arman check it http://askubuntu.com/questions/344802/why-is-apt-get-always-using-proxy-although-no-proxy-is-configured – Anwar Oct 28 '16 at 12:30
  • @Anwar ok so doing sudo echo "Acquire::http::Proxy \"false\";" >> /etc/apt/apt.conf.d/95disable-proxy and then rebooting seems to have resolved it. But why? Can I somehow find out what's setting the proxy up in the first place? – quant Oct 28 '16 at 12:38
  • @arman that's another topic. you might have installed something or configured. That depends on how you were using it – Anwar Oct 28 '16 at 12:42
  • @Anwar ok, thanks! I haved asked another question here: http://askubuntu.com/questions/842800/why-do-i-have-to-disable-a-proxy-in-apt-conf-d – quant Oct 28 '16 at 12:45

0 Answers0