Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a VM running Ubuntu Server 9.10 running a basic web server setup. Whenever I run an apt function it will pause for around 1 minute at 'Waiting for headers...'. It will eventually clear through and continue as normal but it is a bit of an annoyance.

Everything else on the server seems to run fine. Any ideas?

share|improve this question

migrated from stackoverflow.com Jan 25 '10 at 12:46

This question came from our site for professional and enthusiast programmers.

1  
Have you tried using another mirror? Any additional repositories? –  andol Mar 7 '10 at 17:23

4 Answers 4

tldr; Software Source -> Download From -> Other -> Choose Best Server

I had this problem with an ubuntu install. To debug the problem I edited /etc/apt/apt.conf and added Acquire::http::Timeout "3"; which gives a really short timeout and makes it much more obvious what the problem is.

apt-get update then showed a lot of 404's from http://bg.archive.ubuntu.com which was the repository my ubuntu install had chosen.

Under software sources I then went to Download From -> Other -> Choose Best Server. It chose a server in Bulgaria - which actually happened to be the same server, which I suppose bg.archive.ubuntu.com is aliased or redirected to. But in any case, after selecting that server directly rather than the .archive.ubuntu.com alias, apt-get update worked perfectly. This suggests there can sometimes be some kind of problem with DNS or aliasing with the *.archive.ubuntu.com server names, which can simply be resolved by using another server, or even the same server directly by it's non-aliased name.

share|improve this answer

Some repos have issues with http/1.1 pipelining.

Try adding the following to /etc/apt/apt.conf.d/piplining-off.conf:

Acquire::http::Pipeline-Depth "0";
share|improve this answer
    
Brilliant!! added it and apt-get update works even better!! :D –  Aceth Feb 13 '12 at 22:44

Make sure your time & date is set correctly,

I had the same problem and fixed it with a simple ntpdate

Also, find out what it's doing by running sudo strace apt-get update

share|improve this answer

Try commenting out your multiverse and universe repos in your /etc/apt/sources.list

Then do a: apt-get clean all

then finally an: apt-get update

See if that clears it up some.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.