Apt-Get Update: failure to fetch; can't connect to any sources
I realize there are dozens of "apt-get update: failure to fetch" questions (I read through all I could find), but my present circumstance is unique to 12.04 and it affects all sources; not just launchpad. Additionally, I've tried several different servers in Europe and the U.S. as well as the "main server" (wherever that is) and they all yield the same result: I can't connect to any software sources.
Additionally, I'm fairly certain the problem stems from the upgrade from 11.10->12.04 I performed this morning, as updates worked immediately before.
Updates from the Update Manager worked fine and I could download some things (mutter) from the Software Center without incident, which makes me think I can connect to some subset of the Ubuntu servers (however, several other Ubuntu servers--like extras--and some canonical servers are listed as 'unable to connect').
Here is the output from sudo apt-get update:
sudo apt-get update
Ign precise InRelease
Ign precise InRelease
Ign precise-updates InRelease
Ign precise-backports InRelease
Err precise-security InRelease
Err precise Release.gpg Unable to connect to ftp.u-picardie.fr:http:
Err precise-updates Release.gpg Unable to connect to ftp.u-picardie.fr:http:
Err precise-backports Release.gpg Unable to connect to ftp.u-picardie.fr:http:
Err precise-security Release.gpg Unable to connect to ftp.u-picardie.fr:http:
Hit precise Release.gpg
Hit precise Release
Hit precise/partner i386 Packages
Ign precise/partner TranslationIndex
Ign stable InRelease
Ign stable InRelease
Err precise/partner Translation-en_US Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
Err precise/partner Translation-en Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
Ign precise InRelease
Get:1 stable Release.gpg [198 B]
Err precise Release.gpg Could not connect to extras.ubuntu.com:80 (91.189.88.33). - connect (111: Connection refused)
Ign precise InRelease
Err precise InRelease
Err precise InRelease
Err precise InRelease
Err precise InRelease
Err precise InRelease
Err precise InRelease
Err precise InRelease
Err precise InRelease
Get:2 stable Release.gpg [198 B]
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Err precise Release.gpg Unable to connect to ppa.launchpad.net:http:
Get:3 stable Release [1,347 B]
Get:4 stable Release [1,347 B]
Get:5 stable/main i386 Packages [1,268 B]
Ign stable/main TranslationIndex
Get:6 stable/main i386 Packages [769 B]
Ign stable/main TranslationIndex
Ign stable/main Translation-en_US
Ign stable/main Translation-en
Ign stable/main Translation-en_US
Ign stable/main Translation-en
Fetched 5,127 B in 7s (673 B/s)
Reading package lists... Done
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch
W: Failed to fetch Unable to connect to ftp.u-picardie.fr:http:
W: Failed to fetch Unable to connect to ftp.u-picardie.fr:http:
W: Failed to fetch Unable to connect to ftp.u-picardie.fr:http:
W: Failed to fetch Unable to connect to ftp.u-picardie.fr:http:
W: Failed to fetch Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
W: Failed to fetch Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
W: Failed to fetch Could not connect to extras.ubuntu.com:80 (91.189.88.33). - connect (111: Connection refused)
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Failed to fetch Unable to connect to ppa.launchpad.net:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Duplicate sources.list entry precise/main i386 Packages (/var/lib/apt/lists/ppa.launchpad.net_nemequ_sqlheavy_ubuntu_dists_precise_main_binary-i386_Packages)
W: Duplicate sources.list entry precise/main i386 Packages (/var/lib/apt/lists/ppa.launchpad.net_sgringwe_beatbox_ubuntu_dists_precise_main_binary-i386_Packages)Contents of /etc/apt/sources.list:
# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)]/ oneiric main restricted
deb-src precise main restricted #Added by software-properties
# See for how to upgrade to
# newer versions of the distribution.
deb precise main restricted
deb-src precise multiverse universe #Added by software-properties
## Major bug fix updates produced after the final release of the
## distribution.
deb precise-updates main restricted
deb-src precise-updates restricted main multiverse universe #Added by software-properties
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb precise universe
deb precise-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb precise multiverse
deb precise-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb precise-backports main restricted universe multiverse
deb-src precise-backports main restricted universe multiverse #Added by software-properties
deb precise-security main restricted
deb-src precise-security restricted main multiverse universe #Added by software-properties
deb precise-security universe
deb precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb oneiric partner
# deb-src oneiric partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb precise main
deb-src precise mainTesting Alternate sources.list file
These are the steps I followed to produce the following output:
Please backup your sources.list:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backupand then replace the contents of
/etc/apt/sources.listwith the below lines and runapt-get update:
deb precise main restricted universe multiverse deb precise-updates main restricted universe multiverse deb precise-backports main restricted universe multiverse deb precise-security main restricted universe multiverse deb precise partner deb precise main
Output:
someone@someone-UBook:~$ sudo apt-get update
Ign precise InRelease
Hit precise Release.gpg
Hit precise Release
Ign precise InRelease
Ign precise InRelease
Ign precise-updates InRelease
Hit precise/partner i386 Packages
Hit precise Release.gpg
Ign precise-backports InRelease
Ign precise/partner TranslationIndex
Err precise/partner Translation-en_US Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
Err precise/partner Translation-en Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
Hit precise Release
Get:1 precise Release.gpg [198 B]
Ign stable InRelease
Err stable InRelease
Err stable Release.gpg Unable to connect to dl.google.com:http: [IP: 173.194.34.38 80]
Err stable Release.gpg Unable to connect to dl.google.com:http: [IP: 173.194.34.38 80]
Get:2 precise-updates Release.gpg [198 B]
Hit precise/main i386 Packages
Get:3 precise-backports Release.gpg [198 B]
Ign precise-security InRelease
Ign precise/main TranslationIndex
Err precise/main Translation-en_US Unable to connect to extras.ubuntu.com:http:
Err precise/main Translation-en Unable to connect to extras.ubuntu.com:http:
Get:4 precise-security Release.gpg [198 B]
Get:5 precise Release [49.6 kB]
Get:6 precise-security Release [49.6 kB]
Get:7 precise-updates Release [49.6 kB]
Get:8 precise-backports Release [49.6 kB]
Get:9 precise-security/main i386 Packages [32.9 kB]
Get:10 precise/main i386 Packages [1,274 kB]
Get:11 precise-security/restricted i386 Packages [14 B]
Get:12 precise-security/universe i386 Packages [8,594 B]
Get:13 precise-security/multiverse i386 Packages [1,393 B]
Get:14 precise-security/main TranslationIndex [73 B]
Get:15 precise-security/multiverse TranslationIndex [71 B]
Get:16 precise-security/restricted TranslationIndex [70 B]
Get:17 precise-security/universe TranslationIndex [72 B]
Get:18 precise-security/main Translation-en [13.6 kB]
Get:19 precise-security/multiverse Translation-en [587 B]
Get:20 precise-security/restricted Translation-en [14 B]
Get:21 precise-security/universe Translation-en [6,261 B]
Get:22 precise/restricted i386 Packages [8,431 B]
Get:23 precise/universe i386 Packages [4,796 kB]
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Ign precise InRelease
Get:24 precise Release.gpg [316 B]
Get:25 precise Release.gpg [316 B]
Get:26 precise Release.gpg [316 B]
Ign precise Release.gpg
Get:27 precise Release.gpg [316 B]
Hit precise Release.gpg
Get:28 precise Release.gpg [316 B]
Get:29 precise Release.gpg [316 B]
Hit precise Release.gpg
Get:30 precise Release.gpg [316 B]
Hit precise Release.gpg
Get:31 precise Release [11.9 kB]
Get:32 precise Release [11.9 kB]
Get:33 precise/multiverse i386 Packages [121 kB]
Get:34 precise Release [11.9 kB]
Ign precise Release
Get:35 precise Release [11.9 kB]
Hit precise/main TranslationIndex
Hit precise/multiverse TranslationIndex
Hit precise Release
Hit precise/restricted TranslationIndex
Get:36 precise Release [11.9 kB]
Hit precise/universe TranslationIndex
Get:37 precise Release [11.9 kB]
Get:38 precise-updates/main i386 Packages [96.5 kB]
Hit precise Release
Get:39 precise Release [11.9 kB]
Get:40 precise-updates/restricted i386 Packages [770 B]
Hit precise Release
Get:41 precise-updates/universe i386 Packages [27.7 kB]
Get:42 precise/main Sources [524 B]
Get:43 precise-updates/multiverse i386 Packages [1,393 B]
Get:44 precise/main i386 Packages [507 B]
Hit precise-updates/main TranslationIndex
Ign precise/main TranslationIndex
Hit precise-updates/multiverse TranslationIndex
Hit precise-updates/restricted TranslationIndex
Get:45 precise/main Sources [932 B]
Hit precise-updates/universe TranslationIndex
Get:46 precise/main i386 Packages [1,017 B]
Get:47 precise-backports/main i386 Packages [559 B]
Ign precise/main TranslationIndex
Get:48 precise-backports/restricted i386 Packages [14 B]
Get:49 precise-backports/universe i386 Packages [1,391 B]
Get:50 precise/main Sources [1,402 B]
Get:51 precise-backports/multiverse i386 Packages [14 B]
Hit precise-backports/main TranslationIndex
Get:52 precise/main i386 Packages [1,605 B]
Hit precise-backports/multiverse TranslationIndex
Ign precise/main TranslationIndex
Hit precise-backports/restricted TranslationIndex
Hit precise-backports/universe TranslationIndex
Hit precise/main Translation-en
Ign precise/main TranslationIndex
Hit precise/multiverse Translation-en
Get:53 precise/main Sources [931 B]
Hit precise/restricted Translation-en
Get:54 precise/main i386 Packages [1,079 B]
Hit precise/universe Translation-en
Ign precise/main TranslationIndex
Hit precise-updates/main Translation-en
Hit precise/main Sources
Hit precise-updates/multiverse Translation-en
Hit precise/main i386 Packages
Hit precise-updates/restricted Translation-en
Ign precise/main TranslationIndex
Hit precise-updates/universe Translation-en
Get:55 precise/main Sources [3,611 B]
Hit precise-backports/main Translation-en
Get:56 precise/main i386 Packages [2,468 B]
Hit precise-backports/multiverse Translation-en
Ign precise/main TranslationIndex
Hit precise-backports/restricted Translation-en
Hit precise-backports/universe Translation-en
Get:57 precise/main Sources [1,524 B]
Get:58 precise/main i386 Packages [2,719 B]
Ign precise/main TranslationIndex
Hit precise/main Sources
Hit precise/main i386 Packages
Ign precise/main TranslationIndex
Get:59 precise/main Sources [1,052 B]
Get:60 precise/main i386 Packages [1,388 B]
Ign precise/main TranslationIndex
Get:61 precise/main Sources [1,185 B]
Get:62 precise/main i386 Packages [1,698 B]
Ign precise/main TranslationIndex
Err precise/main Sources 404 Not Found
Err precise/main i386 Packages 404 Not Found
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Ign precise/main Translation-en_US
Ign precise/main Translation-en
Fetched 6,699 kB in 15s (445 kB/s)
Reading package lists... Done
W: Failed to fetch
W: Failed to fetch Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
W: Failed to fetch Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
W: Failed to fetch 3 6 Answers
Yes, the name server update does work and if it does work then you've probably updated your IP settings to be static and your server can no longer resolve URLs.
Try the above and if it works, reboot. If it fails after rebooting, then do this:
Edit the template file for the resolv.conf. Ubuntu server rebuilds this every boot.
sudo vi /etc/resolvconf/resolv.conf.d/tail
#add just these two lines >>
nameserver 8.8.8.8
nameserver 8.8.4.4 Then save the file and restart the service:
sudo /etc/init.d/resolvconf restart8.8.8.8 and 8.8.4.4 are just Google's Name Servers. You should be able to add in your own ISP's if you want. If you don't like vi, use nano or vim.
I figured it out reading this article. So credit to them for the tip.
1I just found the answer here. Evidently apt can't handle very many software sources, so I was able to solve my problem by deselecting all except the one I needed to access. This would be a real pain to do frequently, but it's better than nothing. From the site:
1From the "Other Software" tab, disable all PPA repositories, leaving only the official Ubuntu repositories active. Enabling too many PPA repositories (which are non-official) can cause your package manager to become unstable.
Add the line nameserver 8.8.8.8 to your /etc/resolv.conf.
This sets alternate DNS servers (the public DNS servers run by Google), in case it's a DNS problem. It's similar, though not identical, to this other answer (which was posted later, and gives a different method for essentially the same reconfiguration).
1This is caused by some proxy packages like anon_proxy, it passes all of HTTP connections through a local proxy using an environment variable. So, to change this edit /etc/environment and comment out HTTP_PROXY and http_proxy in last two lines.
I have got the same issue, and I was keep checking /etc/apt/sources.list with no luck finding the problematic source. It turns out there is a /etc/apt/sources.list.d directory with bunch of files I have added through the past. I have found the invalid file in that directory, and removed it.
The apt-get update and upgrade is working perfect now.
The same problem brought me here. I am using Ubuntu Server 12.04. None of the above solutions had fixed my problem so I tried other solutions.
I just opened the sources.list on /etc/apt and found out that some of the sources is "restricted".
Just edit the sources.list and remove the "restricted" parameter and it works fine now :)
Hope that works for others too!
3