Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am having some issues while running apt-get from my command line. I looked into some answers in askubuntu and found that we have to edit /etc/hosts file. The only entries present in that were

more /etc/hosts
127.0.0.1   localhost
127.0.1.1   @@@@@@-VB

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Then i added extras.ubunutu.com as below

more /etc/hosts
127.0.0.1   localhost
127.0.1.1   @@@@@@-VB
91.189.88.33 extras.ubuntu.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Still the problem persists. I tried to ping extras.ubuntu.com but failed.

ping extras.ubuntu.com
PING extras.ubuntu.com (91.189.88.33) 56(84) bytes of data.
^C
--- extras.ubuntu.com ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 4999ms

I have changed my username in the question. But that should not be a problem in the VM

Can you please guide me where the problem is and how to fix it. Thanks and appreciated in advance.

share|improve this question
    
Are you sure that the output of terminal command hostname is @@@@@@-VB ? Can you ping www.google.com or any other? –  Sadi Feb 13 at 11:51
    
your /etc/hosts is just if you have no valid DNS Server avaiable or have some special things (like domain names that are not official) - it just resolves a name (extras.ubuntu.com) to an static ip. –  Wolfgang Vogl Feb 13 at 12:05
    
You said; should not be a problem in the VM. Are you using Ubuntu inside a VM? –  AzkerM Feb 13 at 13:29
    
yes. ubuntu inside a VM –  Shash Feb 13 at 13:50
    
Could you please post a screen of the network under the respective VM's settings. Else you may specify what type of network you've selected & is it just you need to browse within the VM? :) –  AzkerM Feb 13 at 13:55

1 Answer 1

You're looking at this problem from the wrong end. Don't edit your hosts file if you don't know why you're doing it. Restore your host file to how it looked from the start. Try pinging both google.com and the address you have issues with - do they work? Run cat /etc/resolv.conf, you should see nameservers. If you don't (or if you do), try putting only the following in there with a text editor like nano (these DNS servers are hosted by Google):

nameserver 8.8.8.8
nameserver 8.8.4.4

Now try pinging both google and the address you have issues with again. Are they resolving to different IP numbers now? In that case, your default DNS (maybe the one your ISP provides) may be outdated or not working correctly.

The main problem here is why your DNS is not working, don't work past that by setting IP numbers to hostnames manually because it does not solve your fundamental issue.

Also, as another answer said, you are not even setting extras.ubuntu.com to the correct IP address, so please stop whatever you're doing if you don't know why you're doing it. Start using a DNS server that works and your problems should hopefully go away.

share|improve this answer
    
I did all suggested steps. but it is still ping google.com ping: unknown host google.com –  Shash Feb 13 at 12:40
    
Note: /etc/resolv.conf should normally have nameserver 127.0.0.1 and you shouldn't edit this file manually either - unless you're sure you know what you're doing ;-) Probably you should look at your other network settings, e.g. Edit Connections... –  Sadi Feb 13 at 13:21
    
What's the output of ifconfig? Can you post it to paste.ubuntu.com ? –  bigbadonk420 Feb 18 at 16:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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