APT "Could not resolve 'in.archive.ubuntu.com'"

11,281

If you can ping IP addresses but not domain names, you have a problem with your DNS. Adding the google DNS (8.8.8.8 and 8.8.4.4) to /etc/network/interfaces and restarting should solve your problem:

auto eth0
iface eth0 inet static
    . . .
    dns-nameservers 8.8.8.8 8.8.4.4

Reference: See Answer #2 Here

Share:
11,281

Related videos on Youtube

Rishab Prasad
Author by

Rishab Prasad

Updated on September 18, 2022

Comments

  • Rishab Prasad
    Rishab Prasad over 1 year

    I am using Ubuntu 14.04 LTS and I am unable to use apt-get update command. I am getting the below error:

    support@node:~$ sudo apt-get update
    Err http://in.archive.ubuntu.com trusty InRelease
    Err http://in.archive.ubuntu.com trusty-updates InRelease
    Err http://in.archive.ubuntu.com trusty-backports InRelease
    Err http://security.ubuntu.com trusty-security InRelease
    Err http://in.archive.ubuntu.com trusty Release.gpg
      Could not resolve 'in.archive.ubuntu.com'
    Err http://in.archive.ubuntu.com trusty-updates Release.gpg
      Could not resolve 'in.archive.ubuntu.com'
    Err http://security.ubuntu.com trusty-security Release.gpg
      Could not resolve 'security.ubuntu.com'
    Err http://in.archive.ubuntu.com trusty-backports Release.gpg
      Could not resolve 'in.archive.ubuntu.com'
    Reading package lists... Done
    W: Failed to fetch 
    http://in.archive.ubuntu.com/ubuntu/dists/trusty/InRelease
    W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease
    W: Failed to fetch http://in.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://in.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Could not resolve 'in.archive.ubuntu.com'
    W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Could not resolve 'in.archive.ubuntu.com'
    W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Could not resolve 'in.archive.ubuntu.com'
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Could not resolve 'security.ubuntu.com'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    Content of /etc/network/interfaces

    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
            address 162.70.211.177
            netmask 255.255.255.128
            network 162.70.211.128
            broadcast 162.70.211.255
            gateway 162.70.211.129
            dns-nameservers 8.8.8.8 8.8.4.4
            dns-search local
    
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      looks like a connection error.... did you try running again?
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      14.04 should still be supported for another year, right? so this askubuntu.com/questions/91815/… doesn't apply?
    • Rishab Prasad
      Rishab Prasad almost 6 years
      @JoshuaBesneatte yea. I tried multiple times but it gives the same error again and again
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      can you ping the servers? could be DNS issue... see this: askubuntu.com/questions/29071/…
    • Rishab Prasad
      Rishab Prasad almost 6 years
      @JoshuaBesneatte cannot ping support@node:~$ ping us.archive.ubuntu.com ping: unknown host us.archive.ubuntu.com
    • velix
      velix almost 6 years
      Try pinging an ip (e.g. ping 8.8.8.8)
    • Rishab Prasad
      Rishab Prasad almost 6 years
      @velix I am able to ping 8.8.8.8
    • Joshua Besneatte
      Joshua Besneatte almost 6 years
      probably DNS issue... add the google dns servers to /etc/network/interfaces -> dns-nameservers 8.8.8.8 8.8.4.4 per the second answer here: askubuntu.com/questions/130452/…
  • Rishab Prasad
    Rishab Prasad almost 6 years
    did the following change but still not working
  • Joshua Besneatte
    Joshua Besneatte almost 6 years
    can you post your /etc/network/interfaces content into your question?
  • Rishab Prasad
    Rishab Prasad almost 6 years
    updated the content for /etc/network/interfaces in the question