1

The IT guy at my mom's office had an old computer that he could give me to make a server out of. I took it and installed Ubuntu Server 12.04.1 LTS on it. However, I have no connection to the internet and I can't figure out how to connect. The preferred end result would be a wireless connection, but for now I'd be happy with any connection, wireless or otherwise.

I ran sudo apt-get update and that returned a whole list of W: Failed to fetch [some arbitrary website]

I read up on a few articles and took this error to mean that I am not connected to the internet. How do I connect?

NOTE: Although I have been using servers/computers/etc. for a while, I am extremely new to Ubuntu. (I have only been using it for 1 day.)

If anyone knows how to fix this or even has a pointer in the right direction, I would be very grateful.

Thanks,

Dylan

1
  • 1
    Can you plug it into an Ethernet connection to grab the updates? Once updated, you should have all the packages you need to get wifi working. Dec 9, 2012 at 22:31

1 Answer 1

3

If you are running a server, I assume you are running without a graphical interface or desktop. If so, you are not running Network Manager. First, let's determine if you have a working ethernet interface. Please run:

ifconfig

Do you see an ethernet interface eth0? If so, hook up an ethernet cable and do:

sudo dhclient eth0

Did you connect; that is, get an IP address from the router or other access point? If so, now we can install some updates and needed software:

sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install vim

Now, let's amend a file for a proper static IP address useful for a server:

sudo vim /etc/network/interfaces

Right now, it probably looks like:

auto lo
iface lo inet loopback

Press Insert to add text and let's set up a static IP address for your ethernet interface:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.155
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1

Press Esc to exit the Insert mode. Proofread carefully. Press :wq. Of course, the details need to fit your system and the address should be outside the range used by the DHCP server in the router. Now let's get the system to read the new changes:

sudo ifdown eth0 && sudo ifup eth0

Check if the new address is working:

ifconfig

It ought to now show the new IP address; in my example, 192.168.1.155. Now see if you can reach the internet:

 ping -c3 www.google.com

Once all this is in order, I suggest you start a new question specifically about wireless.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .