apt-get stuck at 0% ( Connecting to archive.ubuntu.com ) on ubuntu 16.04 and doesn’t proceed

Recently we installed ubuntu 16.04 32bit on our laptop. After installation is done, we wanted to install other packages like gimp, vim etc, using apt-get command, but after multiple tries, apt-get install command always got stuck with something like below message,

 0% [Connecting to archive.ubuntu.com (2001:67c:1360:8001::21)] 

Solution for this, is to edit /etc/gai.conf to allow requests to prefer IPv4.

 $ sudo gedit /etc/gai.conf 

and uncomment 54th line ( precedence ::ffff:0:0/96 100 ) as,

#
#    For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96  100

save this file and run update using below command,

 $ sudo apt-get update 

and now, we can install the packages like vim, gimp etc as,

 $ sudo apt-get install package_name 

lynxbee_ezoic

Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


3 thoughts on “apt-get stuck at 0% ( Connecting to archive.ubuntu.com ) on ubuntu 16.04 and doesn’t proceed”

Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded