Ubuntu Server 12.04 apt-get update errors (404, W: Failed to fetch...)

9,942

OK - after some investigation, the name servers that I was provided for this server were not passing the request through correctly due to some strange way we have traffic filtered within the network. I added a proxy that I knew went around this filter to /etc/environment using http_proxy=ip.of.proxy.server:port and voila! It now works.

I post this in case it helps someone else having a similar headache!

Share:
9,942

Related videos on Youtube

Kai
Author by

Kai

In my downtime I enjoy developing, usually taking on freelance projects here and there.

Updated on September 18, 2022

Comments

  • Kai
    Kai almost 2 years

    I have a new instance of 12.04 server and have been having issues running sudo apt-get update

    The update seems to work fine then it will stop and sit waiting for headers then start spitting 404 errors.

    I have tried the following repos in my sources.list with precise and precise-updates etc. also defined to the same mirror:

    deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
    
    deb http://uk.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
    

    The 404 errors appear randomly sometimes stopping at Get:100, sometimes stopping at Get:400+

    I have now tried a whole different mirror (mirrors.coreix.net) and this seems to go on longer butafter already sometime it is now hanging waiting for headers.

    Any ideas? I have searched and searched the forum with many people experiencing similar issues, but nothing already here seems to assist me...

    It may also be worth noting that this is on an corporate network and I currently have the Network team checking if there is some sort of DNS issue with our internal nameservers, but I can run host google.com and ping google.com and get an appropriate response with no lost packets or anything.

    EDIT: This is the last few lines from the last try that has just completed.

    Get:450 http://mirrors.coreix.net precise-security/main Translation-en [168 kB]
    Get:451 http://mirrors.coreix.net precise-security/multiverse Translation-en [1,299 B]
    Get:452 http://mirrors.coreix.net precise-security/restricted Translation-en [1,253 B]
    Get:453 http://mirrors.coreix.net precise-security/universe Translation-en [56.3 kB]
    Get:454 http://mirrors.coreix.net precise-updates/main amd64 Packages [745 kB]
    Get:455 http://mirrors.coreix.net precise-updates/universe amd64 Packages [231 kB]
    Get:456 http://mirrors.coreix.net precise-updates/main i386 Packages [769 kB]
    Get:457 http://mirrors.coreix.net precise-updates/universe i386 Packages [236 kB]
    Get:458 http://mirrors.coreix.net precise-updates/main Translation-en [334 kB]
    Get:459 http://mirrors.coreix.net precise-updates/multiverse Translation-en [8,293 B]
    Get:460 http://mirrors.coreix.net precise-updates/restricted Translation-en [2,859 B]
    Get:461 http://mirrors.coreix.net precise-updates/universe Translation-en [135 kB]
    Err http://mirrors.coreix.net precise-security/universe amd64 Packages
      404  Not Found
    Err http://mirrors.coreix.net precise-security/main i386 Packages
      404  Not Found
    Err http://mirrors.coreix.net precise-updates/main amd64 Packages
      404  Not Found
    Err http://mirrors.coreix.net precise-updates/universe amd64 Packages
      404  Not Found
    Err http://mirrors.coreix.net precise-updates/main i386 Packages
      404  Not Found
    Err http://mirrors.coreix.net precise-updates/universe i386 Packages
      404  Not Found
    Get:462 http://mirrors.coreix.net precise/main Translation-en [726 kB]
    Get:463 http://mirrors.coreix.net precise/multiverse Translation-en [93.4 kB]
    Get:464 http://mirrors.coreix.net precise/restricted Translation-en [2,018 B]
    Get:465 http://mirrors.coreix.net precise/universe Translation-en [3,341 kB]
    Get:466 http://mirrors.coreix.net precise-security/main Translation-en [168 kB]
    Get:467 http://mirrors.coreix.net precise-security/universe Translation-en [56.3 kB]
    Get:468 http://mirrors.coreix.net precise-updates/main Translation-en [334 kB]
    Get:469 http://mirrors.coreix.net precise-updates/multiverse Translation-en [8,293 B]
    Get:470 http://mirrors.coreix.net precise-updates/universe Translation-en [135 kB]
    Err http://mirrors.coreix.net precise/main Translation-en
      Connection failed
    Get:471 http://mirrors.coreix.net precise/multiverse Translation-en [93.4 kB]
    Err http://mirrors.coreix.net precise/multiverse Translation-en
      Connection failed
    Err http://mirrors.coreix.net precise/universe Translation-en
      Connection failed
    Err http://mirrors.coreix.net precise-security/main Translation-en
      Connection failed
    Get:472 http://mirrors.coreix.net precise-security/universe Translation-en [56.3 kB]
    Err http://mirrors.coreix.net precise-security/universe Translation-en
      Connection failed
    Err http://mirrors.coreix.net precise-updates/main Translation-en
      Connection failed
    Get:473 http://mirrors.coreix.net precise-updates/universe Translation-en [135 kB]
    Err http://mirrors.coreix.net precise-updates/universe Translation-en
      Connection failed
    Fetched 12.8 MB in 1h 39min 45s (2,143 B/s)
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-security/universe/binary-amd64/Packages  404  Not Found
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-security/main/binary-i386/Packages  404  Not Found
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-updates/main/binary-amd64/Packages  404  Not Found
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-updates/universe/binary-amd64/Packages  404  Not Found
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-updates/main/binary-i386/Packages  404  Not Found
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-updates/universe/binary-i386/Packages  404  Not Found
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise/main/i18n/Translation-en  Connection failed
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise/multiverse/i18n/Translation-en  Connection failed
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise/universe/i18n/Translation-en  Connection failed
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-security/main/i18n/Translation-en  Connection failed
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-security/universe/i18n/Translation-en  Connection failed
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-updates/main/i18n/Translation-en  Connection failed
    
    W: Failed to fetch gzip:/var/lib/apt/lists/partial/mirrors.coreix.net_ubuntu_dists_precise-updates_multiverse_i18n_Translation-en  Encountered a section with no Package: header
    
    W: Failed to fetch http://mirrors.coreix.net/ubuntu/dists/precise-updates/universe/i18n/Translation-en  Connection failed
    
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    admin@SNOAP01:/etc$ 
    
    • douggro
      douggro over 10 years
      By chance, are you using a proxy?
    • Kai
      Kai over 10 years
      I wasn't, but I am now and it resolved the issue. Check out my post below.
  • Kai
    Kai over 10 years
    This is ubuntu server with no GUI, these errors are happening with sudo apt-get update
  • dschinn1001
    dschinn1001 over 10 years
    Have overseen this ... you could then edit /etc/apt/sources.list - check there if there is some entry too much ?! But only if you are sure, that server is not down for a while and server is back in next weeks ?! And you could check if the http-entry of this correct or had been modified before your "error" occurred. You should decide only for one server - not for US plus UK both with same entries - this can cause conflict.
  • Kai
    Kai over 10 years
    I have tried mirrors in the us, uk and norway. And now I am using a totally different mirror to the XX.archive.ubuntu.com/ubuntu/ mirror Surely not all these servers will be down? Also it seems to get past the issue sometimes and then stop randomly at another point spewing 404 errors and or sitting waiting for headers.
  • dschinn1001
    dschinn1001 over 10 years
    If some entries are the same, I would choose only one server with this entry. In case you later really need the other servers too, you can modify it anyway...
  • Kai
    Kai over 10 years
    No entries are the same, there is a mirror defined for precise, precise-updates and precise-security for the main, restricted, universe and multiverse repos. The last attempt just completed with errors. I have added the output to the post above.