6

I have Ubuntu 13.04 Server on a Virtual Box which is using 2GB of ram and 20GB of space. It's freshly installed and I cannot use apt-get update.

I have tried the same on an Ubuntu 12.10 Server but it still doesn't work.

Every time I type apt-get update I get

0% [Connecting to ca.archive.ubuntu.com (91.189.92.202)] [Connecting to security.ubuntu.com (91.189.91.15)]

Which then hangs for about 20 minutes, and then this displays

Err http://security.ubuntu.com raring-security Release.gpg
  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]
Err http://ca.archive.ubuntu.com raring Release.gpg
  Cannot initiate the connection to ca.archive.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]
Err http://ca.archive.ubuntu.com raring-updates Release.gpg
  Cannot initiate the connection to ca.archive.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]
Err http://ca.archive.ubuntu.com raring-backports Release.gpg
  Cannot initiate the connection to ca.archive.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]
Reading package lists... Done
W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg  Cannot initiate the connection to ca.archive.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]

W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg  Cannot initiate the connection to ca.archive.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]

W: Failed to fetch http://ca.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg  Cannot initiate the connection to ca.archive.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::1a). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1a 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.

However I can ping the IP address and domain on the server, and I can access it on my Host machine browser

davidrockin@ubuntu:/etc/apt$ ping -c 2  ca.archive.ubuntu.com
PING ca.archive.ubuntu.com (91.189.91.13) 56(84) bytes of data.
64 bytes from ragana.canonical.com (91.189.91.13): icmp_req=1 ttl=49 time=42.0 ms
64 bytes from ragana.canonical.com (91.189.91.13): icmp_req=2 ttl=49 time=43.3 ms

--- ca.archive.ubuntu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 42.088/42.742/43.396/0.654 ms
davidrockin@ubuntu:/etc/apt$ ping -c 2 91.189.92.202
PING 91.189.92.202 (91.189.92.202) 56(84) bytes of data.
64 bytes from 91.189.92.202: icmp_req=1 ttl=49 time=101 ms
p64 bytes from 91.189.92.202: icmp_req=2 ttl=49 time=98.9 ms

--- 91.189.92.202 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 98.976/100.335/101.695/1.395 ms
davidrockin@ubuntu:/etc/apt$ ping -c 3 security.ubuntu.com
PING security.ubuntu.com (91.189.91.14) 56(84) bytes of data.
64 bytes from orobas.canonical.com (91.189.91.14): icmp_req=1 ttl=52 time=112 ms
64 bytes from orobas.canonical.com (91.189.91.14): icmp_req=2 ttl=52 time=44.5 ms
^C64 bytes from orobas.canonical.com (91.189.91.14): icmp_req=3 ttl=52 time=41.0 ms

--- security.ubuntu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 41.038/66.103/112.679/32.967 ms

I have tried modifying my /etc/apt/sources.list file to use a different respository

This is my current /etc/apt/sources.list file, which is the original file that was created when Ubuntu Installed.

deb http://ca.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ raring-updates main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ raring universe
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring universe
deb http://ca.archive.ubuntu.com/ubuntu/ raring-updates universe
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ca.archive.ubuntu.com/ubuntu/ raring multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ raring-updates multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu raring-security main restricted
deb-src http://security.ubuntu.com/ubuntu raring-security main restricted
deb http://security.ubuntu.com/ubuntu raring-security universe
deb-src http://security.ubuntu.com/ubuntu raring-security universe
deb http://security.ubuntu.com/ubuntu raring-security multiverse
deb-src http://security.ubuntu.com/ubuntu raring-security multiverse

I have tried restarting my computer, reinstalling my Virtual Machine, restarting my router many times, modifying the sources.list, and I have been googling for several hours, and can't figure out why it's not working.

I have also attempted to disable IPv6 (http://www.bearfruit.org/2013/05/06/ubuntu-server-having-ipv6-probs-its-easy-to-disable/)

Last night I had setup an Ubuntu Server to test it out, and apt-get update worked last night. Now, it's not working anymore on a new Virtual Machine. The one I created yesterday was deleted, and the new one I created today is not working.

My host machine is a laptop and I am using wifi, the specs of it is

Windows 7
8GB Ram
658 GB HDD (214 GB used)
AMD A8-3520M APU

Edit: I am not behind a proxy/vpn, and my internet connection is fine.

David Tkachuk
  • 101
  • 1
  • 1
  • 8
  • Can you connect trough SSL from within Virtual Box? First off all turn the Windows firewall off briefly. If this not works,take a look at this answer: http://askubuntu.com/questions/178804/wireless-network-in-virtualbox – sandino Aug 25 '13 at 01:16
  • My firewall is disabled and the network adapter for the virtual machine is not a NAT but a bridged adapter – David Tkachuk Aug 25 '13 at 01:33
  • @DavidTkachuk try ping6 -c3 ca.archive.ubuntu.com and ping6 -c3 security.ubuntu.com. Also, change your DNS for Google's or OpenDNS. – Braiam Aug 25 '13 at 23:27

5 Answers5

4

Realizing I am stupid, it had nothing to do with the repositories or the Virtual Machine configuration.

All I had to do, was disable firewall on avast. Something I completely forgot about.

David Tkachuk
  • 101
  • 1
  • 1
  • 8
  • i'm in your shoes i believe, but i don't want to disable firewall on main host and wanted to get internet access on my VM, i tried allowing traffic on virtual bridge /interface my VM on. still no luck – surya kiran Mar 08 '22 at 14:58
1

Looks like it is using ipv6 to apt-get and ipv4 to ping. It might be worth a try to disable ipv6 with a kernel parameter though I haven't needed to do this in a long time myself. In /etc/default/grub add ipv6.disable=1 to GRUB_CMDLINE_LINUX_DEFAULT=... then sudo update-grub

grantbow
  • 976
  • 1
    Disabling IPv6 worked for me, but rather than changing kernel parameters I followed http://askubuntu.com/questions/440649/how-to-disable-ipv6-in-ubuntu-14-04 – Eborbob Oct 20 '15 at 07:07
  • sysctl.conf and enabling sysctl, awesome, good to know. – grantbow Dec 17 '15 at 23:17
1

For future reference, I had this problem because we have a corporate proxy and I was using sudo:

sudo apt-get update

but the http_proxy env var got left behind... Switching to:

sudo -E apt-get update

got everything rolling again.

Lucas
  • 111
0

Case 1: the problem in terminal try to use main root terminal, Linux has two terminals ,try to use root terminals

$ sudo passwd root
[sudo] password for ramesh:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

this for root setup ,

Case 2: to install sudo pack properly ,if sudo commands are not working

type this in terminal

tar -xzf archive.tar.gz

or this

tar -xzf archive-name.tar.gz
cd archive-name
./configure
make
sudo make install

case 3 : if the above commands are not working try to use these commands

to check whats wrong in the terminal

auto-apt run <command_string>

or

apt-get check

or

dpkg-reconfigure fontconfig-config
Braiam
  • 67,791
  • 32
  • 179
  • 269
0

If you are trying to connect from behind the proxy server, then ensure the correct proxy setting are done at

vi /etc/apt/apt.conf 
Acquire::http::Proxy "http_colon//proxyserverip:proxyport"; 

then try

apt-get update

This should see you through the issue.

chaos
  • 27,506
  • 12
  • 74
  • 77