I have a computer of a friend of mine, that runs Ubuntu (I don't know what version, due to the current system status) and while he was updating the kernel, he reboot the computer (yes that could be happen !!, anyway)

Currently I am trying to recover the system by using a live USB, with Ubuntu installed on it.

What I am doing, is the following: Update Failure

The problem is that when I try to execute the fifth step, I am getting error because I do not have Internet access. The computer is properly wired on my rooter, and I have Internet access in any place apart of the shell. This message for example is send it via the live USB. but I cannot access the Internet via the shell.

In my shell I try to use this command:

sudo dhclient eth0

but the result of this command is the following message

sudo: unable to resolve host ubuntu

My hosts file has the following content:

127.0.0.1 localhost
127.0.1.1 ubuntu

# 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
ff02::3 ip6-allhosts

how can I get connected on the Internet, in order to download the appropriate updates ?

UPDATE 1

I just notice, that when I execute the ifconfig I am getting the following warning:

Warning: cannot open /proc/net/dev (No such file or directory). Limited output.

UPDATE 2

I just found that, and looks like solving the problem with dhclient eth0 command, but still I cannot ping Google

UPDATE 3

Now the sudo dhclient eth0 returns the following message:

RTNETLINK answers: File exists

UPDATE 4

I just ping my rooter and I getting response, so, it is looks like I cannot ping outside the rooter (ie. Google)

UPDATE 5

I just run ping 8.8.8.8 and still I am getting result. This means I am able to contact Google public DNS, but not the Google itself.

I just run route -n and I am getting the following result:

root@ubuntu:/# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0

UPDATE 7

Also I notice that the file /etc/resolv.conf it is empty :?

SOLUTION

The solution is the following :

sudo dpkg-reconfigure resolvconf

Kind regards ...

share|improve this question

Your problem is no default route is available as you see (route commanr response). This isobviously because of dhcp failed. So now you can set your network manually or read dhclient man.

Ok manually:

  1. Set your interface ip an mask

    sudo ifconfig eth0 <ipinsideyournrtwork> 255.255.255.0
    

    ip inside your network can be 10.0.0.4 or 192.168.0.4 .

  2. Now you can set default route toyour gateway (router)

    But you must get router ip first. Fortunately you set your interface ip and this is where your network address comes from (ip masked by netmask). To get your router ip requires change the address end .4 to some common number like 1 or 138 or 254. The router ip and client ip must belong to the same network to get ping functional. So try: ping 10.0.0.1 first when you set your ip 10.0.0.4, etc. If you can ping your router then set the default route:

    sudo route default add gw <yourrouterip> eth0
    

    Cool you can check your default route with the route command.

  3. The last step is set your dns server. But check your default route before, just try ping some ip outside your network, like google dns server 8.8.8.8 .

share|improve this answer

it is not good idea to write answers on ubuntu touch and nexus7. sorry so last step, set dns server, just edit /etc/resolv.conf and add following line nameserver 8.8.8.8 where the ip is your name server, which can be also different like 8.8.8.4 or 8.8 8.1 or 212.47.1.4 or other public dns server. So now you can ping google.com. Good luck, jaro123

share|improve this answer
    
You can edit your post with the edit link under the answer to change the information provided. Also, see here for information about how you can format your posts: stackoverflow.com/editing-help – minerz029 Nov 3 '13 at 11:22

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.