This turned out to be dead easy, although it took a bit of futzing around due to my own slowness. The situation arose during an a failed upgrade of my dad’s machine to Ubuntu 10.04 (aka Lucid Lynx). I’m sensing a pattern here; I don’t think there has been an upgrade that has gone smoothly on that machine. To be fair I think there may be problems with just about every component apart from the hard drive, but you think I would realise that upgrading that machine is a Bad Idea. Anyway, the solution:
A combination of
wpa_passphrase will do the trick.
- Get a root prompt. Either
sudo su, or boot to single user (recovery) mode. Just don’t do that, select netroot, then get bored and hit Alt-F1 for a console 1. For some reason, that makes the machine very unhappy and so your wireless hardware probably will complain about device busy in step 2. So don’t do that.
iwlist scanning, and check your card can see the wireless network in question
- If it can, run
wpa_passphrase [your-wireless-network-name] > wpa.conf
wpa_passphrase pegasus > wpa.conf). The prompt will wait for you to enter a passphrase. Do this and hit enter.
wextwith the correct wireless driver (which is probably
wext, but run
wpa_supplicant --helpto check) and
wlan0with your wireless interface
wpa_supplicant -Dwext -iwlan0 -c/root/wpa.conf
- If that works, you should see text to the effect of “successfully associated”. If not, try again with a different driver, make sure your passphrase is correct, and make sure your wireless interface is working properly.
- Hit Ctrl+c, then the up arrow, then add a -B (for background) onto the end of the last command, thus:
wpa_supplicant -Dwext -iwlan0 -c/root/wpa.conf -B
dhclient -rto release any DHCP leases you have.
dhclient wlan0to get a new IP address. Substitute
wlan0for your wireless interface, of course.
You should now be connected. This is a handy trick for any Linux user unaccustomed to connecting to wireless networks from the command line – let’s face it, network-manager has spoiled us rotten. But when an upgrade fails and won’t leave you with a functioning graphics driver (grr) and you need some packages, this is the way to do it.