Ubuntu: Network Problem While Reinstalling Grub



Question:

I'm trying to reinstall grub on a second disk, following the instructions at Purge & Reinstall Grub.

After doing sudo chroot /mnt, when I attempt apt-get update, I get lot of failed to fetch messages. Apparently DNS is not working, since running the host command on any hostname times out: no servers could be reached.

If I exit the chroot, host and apt-get update work just fine.


Solution:1

According to your description your chrooted environment has no information about valid nameservers (DNS). You can copy the file /etc/resolv.conf into the etc directory of your chroot environment. You could also edit the file /mnt/etc/resolv.conf (or if you are inside the chroot in /etc/resolv.conf) and add the line

nameserver 8.8.8.8  

This uses a nameserver from Google.

When your system has valid information about DNS servers it will work again as expected.


Solution:2

Inside the chroot, edit /etc/resolv.conf (nano /etc/resolv.conf) and insert the following line:

nameserver 8.8.8.8  

Name resolution should work now.

PS: Press Ctrl+O,Enter to save the file in nano and Ctrl+X to exit.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »