0

I am brand new to Ubuntu and Ubuntu Server. My aim is to set up a Plex media server using Ubuntu Server 16.04 LTS. Ubuntu has been successfully installed on my system which has a hard wired internet connection but I keep getting errors and "Failed to fetch..." prompts after executing command "sudo apt-get update". Even after restarting the system and/or powering off and restarting, the issue remains.

I also tried to ping Google.com using "ping -c3 www.google.com" but I get the response "unknown host www.google.com" so not sure if there might be a network issue (see attached image for errors and other issues mentioned).

[Image showing command line errors][1]

I've done quite a bit of scouring but can't seem to find a solution. I am also new to the CLI, so any help would be much appreciated.

EDIT:

I had initially set up my server with a static IP but was getting no internet connection. As per instruction from @Joel to get a new IP address from my router, a new IP was obtained by updating the Network Interfaces file using the VI Editor (command: sudo vi /etc/network/interfaces) and changing the primary network interface back to 'dhcp' from 'static' (iface enp3s0 inet dhcp).

After rebooting I was successfully able to ping 8.8.8.8 (Google) and thus perform updates.

Big thanks to @joel and @f35 for your support.

0

You can try changing the DNS-server your server is using. To do that type in the following command:
nano /etc/network/interfaces
and add the following line (or change it if it's already there) :
dns-nameserver 8.8.8.8 8.8.4.4
Now your server should use the Google dns server (but of cause you can use any other dns server you want)

EDIT: Now that you have shown the result of ping 8.8.8.8 its looks like your pc is not connected to the internet. You can try to get a new ip-adress from your router by typing sudo dhclient -r eth0 If this still does not work you can try assigning you pc a static ip-adress.

  • Thanks for the quick response, Joel. Using "nano" comes back with "invalid command". After previously watching a video online I've been replacing "nano" with "vi" which brings up the vi editor I believe it's called. That way I've been able to change the info in the interfaces file. I've changed the DNS-server as instructed but I'm getting the same errors. – ShadowRa74 Dec 13 '16 at 18:26
  • try restarting the server after changing the dns server – itssme Dec 13 '16 at 18:36
  • Yep, did that, typed the update command, same result. – ShadowRa74 Dec 13 '16 at 18:39
  • ok, I forgot to mention that you will have to add that line below the interface you are using. If you are wired it should be 'eth0' and will look something like "iface eth0 inet static" – itssme Dec 13 '16 at 18:43
  • I wish I could send an image of the results I get but it seems I can't do so when replying to your comments. I mentioned the same to @f35. In addition instead of showing 'eth0' I get 'enp3s0'. From what I've read this is a new thing in Ubuntu Server 16.04.1 – ShadowRa74 Dec 13 '16 at 18:49
0

Is ping 8.8.8.8 working ?

If no, it means you have a network configuration problem.

Show us the result of

  • ifconfig -a
  • netstat -rn
  • Thanks for your quick response also, f35. I wish I knew how to copy and paste the results of the commands you gave, would make replying a whole lot easier! Forgive me. And if I add an image to my response it just shows the location of the image on my computer in text format – ShadowRa74 Dec 13 '16 at 18:47
  • That said, the ping result for 8.8.8.8 came up 'Desitnation Host Unreachable'. – ShadowRa74 Dec 13 '16 at 18:53
  • Ping 8.8.8.8 is not working. "Destination Host Unreachable". See image in updated question for 'ifconfig -a' and 'netstat -rn' – ShadowRa74 Dec 14 '16 at 20:34
  • Your default gateway is 192.168.1.254, are you able to ping it ? ping 192.168.1.254, is it correctly configured ? Does it provides a correct dhcp ? – f35 Dec 15 '16 at 19:36
  • Pinged the gateway, again 'Destination Host Unreachable'. I've set up my Ubuntu machine with a static IP using the VI editor and used the IP address provided from 'ifconfig' – ShadowRa74 Dec 15 '16 at 23:50

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.