2

My problem started with this question: Failed to start Load Kernel Modules Ubuntu 16.04

Now I can boot but only log in on tty1. I am trying to get sudo apt-get update to work to try and fix all the other issues. The problem is, that I can not connect to the internet. ifconfig tells me that I have a connection, and sudo dhclient wlan0 and sudo dhclient eth0 now execute successfully, but pinging any host won't work via hostname (I always get a unknown host error). I can successfully ping 8.8.8.8 though.

service network-manager status shows active and running

ip route has a default route default via 192.168.1.1 dev eth0

How can I connect to the internet?

Fullk33
  • 201

1 Answers1

2

It looks like you are booting in single-user, networkless, failsafe level.

To fix your DNS issues, just:

echo "nameserver 8.8.8.8" > /etc/resolv.conf

Then at least from that session, you should be able to ping by hosts. Assuming 8.8.8.8 is ping-able (as you stated) and that it is one of google's free DNS servers.

This way, while you'd have DNS servers set up, it is not guaranteed that apt-get will work. As a fail-safe boot, partitions might have been mounted read-only or not mounted at all.

If you can't create/edit /etc/resolv.conf because the filesystem is mounted read-only, as being root you can fix that (assuming the filesystem can be mounted read-write -- i.e. not a hardware limitation) with:

mount -o remount,rw /

Then do the command again to set the nameserver. Assuming /etc is a directory under partition mounted in /, and no dedicated partition for /etc.

To add another DNS server (append) to the file:

echo "nameserver 8.8.4.4" >> /etc/resolv.conf
Avenger
  • 21
  • by "pingable" I meant "reachable". i.e. if your ISP filters access to DNS services, you might want to use your ISP's provided DNS server address (or maybe your modem or router's IP address -- if cable, adsl, this may be the case!). They may block effective DNS access while still letting ICMP (ping) requests go! – Avenger Aug 09 '16 at 05:22
  • Ok thank you, I will try doing this as soon as I can. – Fullk33 Aug 09 '16 at 08:37