On googling this error it seems that a lot of people are having this issue.

apt-get upgrade hangs at 0% [waiting for headers] apt-get install apache2 hangs at 0% [waiting for headers]. Some apt-get commands are working, but only certain packages.

Any ideas? I don't think this is an issue with slow repos because I've had it up for a long while and it hasn't budged from 0%. I have edited sources.list but I removed the lines I added when this issue presented itself and it hasn't made a difference.

Any clues would be really useful.

  • Your Internet connection is disconnected... – αғsнιη Sep 27 '14 at 5:13
  • askubuntu.com/questions/156650/… read the mtu related answer, might be a help – Eslam Shapsough Oct 5 '14 at 22:30
  • I have tried all the solutions above, none of them work. I even tried a reboot at the command prompt, still the same,the 0% remains stuck forever. This is a serious issue because it hampers, slows down, or even prevents the user from installing and running programs or apps. I have never seen this happen in Ubuntu 14.04. I don't think it's caused by problems of Internet connection, because whenever the problem occurs I keep checking my browser by going to different websites and I am able to surf with no problem. I think it's a bug in Ubuntu 16.04 and it needs to be fixed fast. – Plutarc Nov 28 '16 at 22:39

Try to change the server selecting update manager, definitions,downloading from, then select a server more near you. and then try again.

Edit: see this link on how to add it by editing sources.list. How can I get apt to use a mirror close to me, or choose a faster mirror?

  • 2
    any idea how to do this over ssh? – Thomas Clayson Jan 12 '12 at 10:31
  • 2
    You edit /etc/apt/sources.list to point to a different mirror – tumbleweed Jan 12 '12 at 10:35

The easiest approach consist of following commands:

sudo apt-get clean


sudo apt-get update


sudo apt-get install <package_name>


Let me know if it works

  • 1
    It worked for me.. – igaurav Dec 6 '13 at 8:41
  • 6
    Didn't work for me. – isomorphismes Mar 28 '14 at 8:09
  • @isomorphismes can you describe more ? maybe error or some screenshots – igaurav Mar 28 '14 at 14:10
  • I posted the question here: askubuntu.com/questions/439829/… – isomorphismes Mar 29 '14 at 4:03
  • @isomorphismes i guess that is different issue seems like misconfiguration of proxy settings. – igaurav Apr 14 '14 at 11:49

I had to

sudo apt-key update
sudo apt-get update

From manpages:

apt-key is used to manage the list of keys used by apt to authenticate packages. Packages which have been authenticated using these keys will be considered trusted.

  • apt-key does not magically make HTTP responses happen. – Chai T. Rex Jan 26 '18 at 20:17
  • @ChaiT.Rex It does however update the keyring which solved the problem for me. – Stiin Jan 29 '18 at 21:25
  • The keyring isn't the problem with 0% [waiting for headers]. The problem with 0% [waiting for headers] is that the HTTP connection has stalled. Retrying the command will start a new HTTP connection, which might not get stuck. That (running sudo apt-get update again) is what solved the specific problem of 0% [waiting for headers] for you. Keys are involved in the process after the HTTP connection is finished, when checking the finished downloads. – Chai T. Rex Jan 29 '18 at 21:28

If you are using a proxy server and have those settings in your user environment, try:

sudo -E apt update

to run the command as root but using your current user's environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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