Ubuntu apt-get Hangs At 0%

Ubuntu apt-get Hangs At 0%

apt-get-stuck-0-percent

I had an issue where I installed Ubuntu 14.04 in VirtualBox and apt-get kept hanging at 0%.

I noticed it was automatically attempting to use IPv6 because normally apt-get says connecting to us.archive.ubuntu.com the IPv4 address (eg 0% connecting to us.archive.ubuntu.com 111.111.111.111). This time the address looked like version 6.

To force apt-get to use IPv4 exclusively

  1. Create a file in /etc/apt/apt.conf.d/99force-ipv4
  2. Add this line to newly created file Acquire::ForceIPv4 true;
  3. Apt-get will now use IPv4 exclusively

 

This article on StackExchange helped me find the right answer!
Convince apt-get *not* to use IPv6

Share this Story
  • Ubuntu apt-get Hangs At 0%
    Linux Tech Tips Ubuntu

    Ubuntu apt-get Hangs At 0%

    I had an issue where I installed Ubuntu 14.04 in VirtualBox and apt-get kept hanging at 0%. I noticed it was ...
Load More Related Articles
Load More By Nick Escobedo
  • Ubuntu apt-get Hangs At 0%
    Linux Tech Tips Ubuntu

    Ubuntu apt-get Hangs At 0%

    I had an issue where I installed Ubuntu 14.04 in VirtualBox and apt-get kept hanging at 0%. I noticed it was ...
Load More In Linux
  • random linux user

    thanks!

  • Garret

    The line to add to should be “Acquire::ForceIPv4 true;” not “Acquire::ForceIPv4 false;”

    • Thank you for taking the time to comment!
      I have fixed the post.

  • I was able to fix this problem pretty quick by doing the following.

    In a terminal type: sudo vim /etc/gai.conf

    Scroll down and uncomment the line that says: precedence ::ffff:0:0/96 100

    Make sure not to uncomment the wrong line, which is what I did the first time. There is a line that looks exactly the same as the correct line, but if you look close you’ll see that it ends with “10” instead of “100”.

    • vrna

      does NOT work. I repeat: it does NOT work

  • efi9091

    I got no permission in adding the line of the newly created file. any idea?

    • If you have sudo access then create the file with sudo.

Check Also

Selecting Your Next App Dependency

We often turn to open source or proprietary packages for adding functionality to our apps. Here are some key points and questions to ask when selecting your next dependency.