Muffinresearch Labs by Stuart Colville

Linux: Fix for apt-get update – Waiting for Headers | 5 Comments

Posted in Code, Linux/Unix on 30th March 2010, 9:48 pm by

terminal showing waiting for headers at 99%

If you’re a Google chrome user on Ubuntu you may have noticed apt-get update seems to wait around for two minutes sitting at 99%. The culprit is the google apt repo having issues with http/1.1 pipelining. Fortunately there’s a bug for it on Launchpad with a workaround that does the job. Thanks gozdal!

The solution boils down to turning off http/1.1 pipelining. Here’s how (note the bug listed above lists the incorrect path to the conf dir):

Open /etc/apt/apt.conf.d/google-workaround.conf with your favorite editor. (You’ll need sudo e.g. sudo vim or gksudo gedit).

Add the following line:

Acquire::http::Pipeline-Depth "0";

Save it and run sudo apt-get upgrade again and you should find it completes without the 2 minute delay.

Post Tools

  • William

    everyone says to add this but for us noobs just learning Linux at what point do we add this in the middle?, at the end?before what?after what? I can open file and edit it in VI but I’m not sure if I’m entering in correct place because this isn’t working for me.

  • http://muffinresearch.co.uk Stuart Colville

    Hi William, apologies, I’d not make it clear that the file in question should be a new file. The name “google-workaround.conf” is the name I came up with but really you can call this what you like. The idea of a conf.d directory is that all conf files in that directory are looked at by the service in this case apt. So in other words and to answer your question, there’s no middle/end/after anything because it’s a new file.

  • paccer

    Wow! Thanks!
    This reduced my 2 minute update to 5 seconds..

  • venik

    It is now June 2011, and this problem is still with me, even though I used that workaround…..
    Pathetic.

  • Arshad

    I am also suffering from the problem even after saving the file.
    My problem is a bit different though… My ‘apt-get’ flows smoothly through upgrade but gets stuck with update (and i think … infinitely – i have waited for about 15 minutes).

    Any ideas?

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.485s.