1

I am running a VM of Ubuntu server 14.04.4 using virtual box. I have configured the network to be in "bridged adapter" config. I have manually assigned IP of the same address as the network the host windows machine is on. Gateway is the wireless router. I am able to ping public IPs and URIs are being translated as well.

When i try to install a software package like 'chrony', with sudo apt-get install chrony, i get the following output immediately.

root@controller:~# apt-get install chrony
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package chrony

When I try to update apt with sudo apt-get update I get the output,

    root@controller:~# apt-get update
Err http://extras.ubuntu.com trusty InRelease

Err http://extras.ubuntu.com trusty Release.gpg
  Unable to connect to extras.ubuntu.com:http:
Err http://archive.canonical.com trusty InRelease

Err http://archive.canonical.com trusty Release.gpg
  Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]
Err http://in.archive.ubuntu.com trusty InRelease

Err http://in.archive.ubuntu.com trusty-updates InRelease

Err http://in.archive.ubuntu.com trusty-backports InRelease

Err http://in.archive.ubuntu.com trusty Release.gpg
  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]
Err http://in.archive.ubuntu.com trusty-updates Release.gpg
  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]
Err http://in.archive.ubuntu.com trusty-backports Release.gpg
  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]
Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
  Unable to connect to security.ubuntu.com:http: [IP: 91.189.91.23 80]
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to extras.ubuntu.com:http:

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to archive.canonical.com:http: [IP: 91.189.92.150 80]

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]

W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Unable to connect to in.archive.ubuntu.com:http: [IP: 91.189.88.152 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Unable to connect to security.ubuntu.com:http: [IP: 91.189.91.23 80]

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

My /etc/network/interfaces is:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1

#2nd if
auto eth1
iface eth1 inet static
address 192.168.1.100
netmask 255.255.255.0
#gateway 192.168.0.1


dns-nameservers 8.8.8.8 4.2.2.2

my /etc/apt/sources.list file looks like this

#deb cdrom:[Ubuntu-Server 14.04.4 LTS _Trusty Tahr_ - Release amd64 (20160217.1)]/ trusty main restricted

#deb cdrom:[Ubuntu-Server 14.04.4 LTS _Trusty Tahr_ - Release amd64 (20160217.1)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-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://in.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty universe
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-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://in.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-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://in.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

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

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

I have tried to disable IPv6 routing for this. I havent faces such an issue with previous attempts, I feel stumped after three days. Any insight would be appreciated. Feels like I have missed something glaringly obvious, but being oblivious to it.

Many Thanks.

  • I think the Download Server is borken. Try changing to Main Server by remove tin in. in every uncommented line at your /etc/apt/sources.list file as described here askubuntu.com/questions/104695/…. Then run sudo apt-get update. – Thanos Apostolou Jun 21 '16 at 22:25
  • Do you mean to replace in. with main. in the sources.list file? – panickedprocrastinator Jun 22 '16 at 6:40
  • For example make the line deb http://in.archive.ubuntu.com/ubuntu/ trusty multiverse look like deb http://archive.ubuntu.com/ubuntu/ trusty multiverse. – Thanos Apostolou Jun 22 '16 at 9:20
  • didn't change any thing. Deleted the ' sources.list' and replaced it with another standard one. Didn't help either. – panickedprocrastinator Jun 22 '16 at 17:50
0

Try to ping 'google.com' ... and if it failed to ping then do the following:

Edit /etc/resolv.conf and add

NOTICE: You can use any text editor, for example 'vi /etc/resolv.conf'

nameserver 8.8.8.8
nameserver 8.8.4.4

At the end of /etc/resolv.conf - or at the top if it was empty file.

It should work now, please tell me what happened in the comments :)

EDIT: I noticed in /etc/network/interfaces - that's you already have the "dns-nameservers" field initlized to the Google Nameservers, but try doing that on my method too :)

  • But editing '/etc/resolv.conf' by hand makes the changes non persistent. That is why added them n interfaces file. Anyh way, I am able to ping several FQDNs, so doesn't seem like a DNS issue. – panickedprocrastinator Jun 22 '16 at 6:38
  • Check the above answer, (tested). – protld Jun 22 '16 at 13:14
0

EDIT: Well! this solution will 100% fix it (I hope) ... Because I tried to use your 'sources.list' copy and I got the same problem... After that I tried to revert the default 'sources.list' using the below method and it 100% worked (Tested!) :)

Well, as your network settings are fine and you're able to ping everything well. Let's restore the default 'sources.list' file of your Ubuntu installation.

So start by deleting the corrupted 'sources.list' and we will replace it in the next steps:

sudo rm /etc/apt/sources.list

Now open 'software-properties-gtk' which will automatically create a new empty 'sources.list' file

sudo software-properties-gtk

In 'software-properties-gtk' , tick (check) 'Community-maintained free and open-source software (universe)'

Then set 'Download from:' as 'Server for USA' or any server which is near to your location.

And of course, click the 'Revert' button.

image

  • this is does not help, need apt to install 'software-properties-gtk' , and running ubuntu server without gui.can't try this since i don't have apt working. Replacing sources.list by other means does not work either. Ty for trying. – panickedprocrastinator Jun 22 '16 at 17:47

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.