I am trying to make a simple server on an old macbook. I got Ubuntu 14.04 installed, but I need to use
apt-get to install some packages, and
apt-get will not work.
The problem is that
apt-get cannot connect to ubuntu.com. I see the error
Could not resolve 'us.archive.ubuntu.com'
I tried to ping google.com and 126.96.36.199, and they cannot be reached either. I edited my
/etc/resolv.conf file to include
nameserver 188.8.131.52 and I still couldn't get out.
I figured it must be the wifi connection, which is weird because I configured the wifi during installation and it was working fine. I have been spending the past several hours trying to get
wpa_supplicant -iwlan0 -Dwext -c<(wpa_passphrase <my SSID> <my password>)
(which I am most definitely running as a superuser) to work. It doesn't. It immediately spits out the following
Successfully initialized wpa_supplicant ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWSCAN]: Device or resource busy
after which it enters an infinite loop of trying to connect and failing.
It is possible that the device is busy because I had earlier put in a
wpa_supplicant command with the
-B option, which put it in the background, and I can't figure out how to kill the background process. But before that, I was having a similar problem: I just can't connect to the internet.
Since I can't connect to the internet, I have no access to apt-get so if it isn't in the standard Ubuntu 14.04 server distro, then I don't have it.
I was able, once, the first time, to get a
ping google.com to return something, but it quickly went away and I haven't been able to duplicate anything.
What do I do here? Am I missing something really simple
(I did check that wlan0 is turned on, and I did scan for my SSID and it does show up in a scan. I just can't connect to it. I have double checked the password I'm using: it is the one written on the box, and it works on every other machine in the house)
EDIT: I removed
D wext from the
wpa_supplicant request. That is, I entered
wpa_supplicant -iwlan0 -c<(wpa_passphrase )
This doesn't let to connect to the internet still, but it removes the complaints about invalid arguments.
EDIT: I got it to work. My routine is (from root)
>ifconfig wlan0 up >iwlist scan|less >wpa_supplicant -iwlan0 -c<(wpa_passphrase <SSID> <password>)
If that connects, then I type it again but with -B to run it in background, then
>dhclient -r >dhclient wlan0 >ping google.com
It should start returning data from google. If not, I kill the background process with
>kill `pidof wpa_supplicant`
This works for me.