Enable WPA Wireless access point in Ubuntu Linux

I have a Thoshiba laptop at home, I was running “Dapper Drake” (Ubuntu Linux 6.06) But one of the important things about it was its inability to connect to WPA-encrypted Wifi access points.In my home i have a WPA Enabled Wireless router so i need to connect to my wireless network using WPA.I am giving the procedure that worked for me to enable wpa in my toshiba laptop.

Procedure to enable WPA Wireless in Ubuntu

To update the source list run the following command

sudo apt-get

sudo apt-get install wpasupplicant

sudo apt-get install network-manager-gnome network-manager

sudo gedit /etc/network/interfaces

Comment out everything other than “lo” entries in that file and save the file

Create a file called /etc/default/wpasupplicant, add entry ENABLED=0 and save the file

sudo touch /etc/default/wpasupplicant

Reboot your system or use the following command

sudo /etc/init.d/dbus restart

Once you login back in to your machine you need to left-click the network manager icon in Gnome and select your wireless network It should prompts for password, type, etc and It will ask you to choose a password for your new “keyring”.

After enterring all the details my wireless network was connected and working fine you can see in the follwoing screen

My wireless network also detected available wireless access point around my home you can see this in the following screen

If you want to connect an existing wireless point you can see the following popup box asking for details of wireless network

If you want to create a new wireless network you can see the following screen with the available options and after entering all the details you need to click on connect

Possible Error and Solution

If you see the following error

The NetworkManager applet could not find some required resources. It cannot continue.


sudo gtk-update-icon-cache -f /usr/share/icons/hicolor/

Sponsored Link

248 thoughts on “Enable WPA Wireless access point in Ubuntu Linux

  1. I am in the same boat as Shailesh–just put Hardy Heron on my Presario 2500. The wifi0 and wlan0 initially appear in the network interface list, set to “roaming mode”. In order to enter the WEP key the roaming must be unchecked, which puts it in manual configuration mode. It accepts the configuration options, but then fails to connect. When the network interface list is closed and re-opened the wifi0 and wlan0 are gone, and there are two instances of the wired lan interface instead.

    At the command line the iwconfig command reports it is not installed, and suggests apt-get for madwifitools. I have previously used this to successfully configure a D-Link PCI wifi card and also with a PCMCIA card in my old IBM ThinkPad 600 (Xubuntu). I am going to see if this can solve the issue–will post again if it does.

  2. Correction–it is wlanconfig that reports it needs to be installed as with madwifi-tools, not iwconfig. Doesn’t matter, though because I didn’t need it anyway. Here is what you do to get the onboard wifi working in the Presario 2500. In a terminal session, do:

    sudo iwconfig wlan0 essid
    sudo iwconfig wlan0 key
    sudo dhclient wlan0

    This should have your wlan connection up and connected. Unplug your ethernet cable and ping an ip address or open a web page.

    This will need to be put in a boot script so that you don’t have to key it in manually with each restart.

    Cheers, Lonn

  3. my last post did not upload correctly. It should read:

    sudo iwconfig wlan0 essid {your_essid}
    sudo iwconfig wlan0 key {your WEP key in hex}
    sudo dhclient wlan0

    Apparently, things entered between angle brackets get treated as tags and don’t show. Hence the curly brackets this time. Ooops. -Lonn

  4. AWESOME !!

    That worked great, after days of trying everything I could find online, you did it for me.

    Thank You Very Very Much !!!

  5. That was great!
    Thank you very much. You made my day.
    Now, I feel more than ever that I should switch from commercial operation systems to Linux that are supported very well by everybody.

    Thanks again

  6. That works. We have to use closed-source drivers, but we managed to use a wireless network in our dental practice.

    Implanty Warszawa
    Bluedental Ximplant

  7. Well, you are definitely the man and I am very grateful but this post you had to make illlustrates my big frustration with Linux. It just isnt ready for the average user yet again after so many years. I consider myself a very experienced user and even programmer but whenever I tried Linux I always had to dig in obscure information just to make simple things work. Why wasnt I able to connect to wireless from the get go right after installation? Why did I need to lose several hours trying fruitless solutions? What would have happened if I didnt stumble upon this post. I would still be trying…I am sure Linux gets very exciting once you get to know it, but it is these kinds of problems and experiences that drive the naive user immediately back to where he/she came from (i.e., Windows).

  8. Can you tell me how to do the same but on the latest version of Ubuntu Hardy Heron.

  9. hi,

    I have a windows vista OS. I installed ubuntu on my comp. now in ubuntu, when I go to the network setting I do not get an option for wireless connection. the wireless connection is available when i run my comp on vista. Please tel me what do I need to do get this option.


  10. Hi,

    Very good tutorial. It worked fine to configure my IBM T42p.
    OS: Debian 4.0
    NIC: Intel 2200 B/G => IPW2200
    Window Manager: Gnome

    Thanks, Keep going


  11. This solution partially works for me. I followed the instructions to the letter and I can now see my router and connect to it. At least that’s what my computer indicates when I rollover the network icon in the task bar. It says “Wireless network connection to ‘homebase’ (97%)”.

    When I run any of my browsers, I get no network response.

    Any ideas about what is going on?

  12. I notice your network icon is the same as what comes with my TrendNet TEW-424UB. I have a problem with mine in that it works just fine for a while but eventually stops. Network tools shows it’s still connected, but it just doesn’t do anything anymore. It looks like maybe system (network) resources are maxing out. Is there as problem using a 13H HDD and with the default install (8.10 beta) youget on ly a small swap partition. How do I make sure there’s a big enough swap partition and enough memory and cache for any wireless use?

  13. My Problem is that i dont have connection to the internet… must be by WPA connection from my house router =/

    i dont know what to do =/

    these apt-get commands must have internet… i cant get connection =/

    My network is Online, with Internet connection, but…. when i Connect to my router it says im connected… but im not online (internet)

    lol… can any one help me?? ^^

    thanks in advance

    (damn bad english… sorry >.< )

  14. This was really helpful! I installed Ubuntu 8.10 recently by upgrading from 8.04. Somehow, I lost my internet connection. I may have lost information in trying to get the wifi radar to work. This is one of the few things not working in 8.10 but was working in 8.04.

  15. excellent article dude mate !!
    Works like a charm.
    Thanks for sharing this valuable information and making life easier for everyone out there struggling to get the wireless working with wep.

  16. “Create a file called /etc/default/wpasupplicant, add entry ENABLED=0 and save the file”

    i complete newbie in linux please help me create this file i’m unable to create this file rest of the method i understood but creating file in linux is difficult for me.Moreover i have dual boot linux/xp Dell D600 laptop.

  17. First

    In terminal: enter “su username” will allow you to assume the privileges of that user, in your case probably user=root

    than you can change folder owner to your user

    $ chown -Rv username somedir
    changed ownership of ‘somedir/’ to username, username=your login

  18. This is awesome… I’m ubuntu newbie and first problem i have encountered is with connecting with my wireless network with WPA enabled, just followed instruction above got my wireless connection problem fixed in instant


  19. Just a few moment. I’m new in Linux’s world. So, from the ‘Comment out everything other than “lo” entries in that file and save the file’, I’ve stuck in this point. I needs more detail explanation.. Please, do anyone can help me?

  20. iv been having some problems on step sudo apt-get install manager-gnome network-manager….
    it says: E: unable to fletch some archives;run apt-get update…but when i run apt-get it says:some index files failed to download,they have been ignored or old ones used instead…or unable to lock the list directory,could not open lock file…
    help please

  21. This is a perfect example of why Linux is having a slow uptake, too many bugs to get it up and running in a smooth way. Until this sort of crap is worked out once and for all Linux will go the way of DOS.

  22. I am running ubuntu 8.10 on a Tecra A2 with a 2200BG wireless card using the IPW2200 driver. I can connect to the wireless using WPA-PSK, but I can’t get on the network. It seems that I can transmit but can’t receive any packets. They all error out. In network tools, it shows transmitted packet with now errors, but the received packets shows lots of errors. I can’t ping anything on the network and can’t get on the internet. On my router, I can see the laptop on the dhcp client list when running dhcp. It gets an ip address just fine.

  23. It works! But Woody is right.

    1 Make sure you get the right driver running, i.e. blacklist a wrong one, e.g. orinoco if you need hostap.
    2 Have this file /etc/default/wpasupplicant with the mentioned content: ENABLED=0


  24. @Jyesj

    In Ubuntu and Kubuntu type:

    sudo gedit

    In Xubuntu type:

    sudo mousepad

    This gives you a blank text file… just type ENABLED=0 and browse to ect folder, then default folder, double click on the default to open it, then save.

  25. I’m having trouble getting the network connection to work consistently. It works just fine with WEP or unsecured networks, but the computer doesn’t seem to pass the information needed for WPA everytime. I think it is somehow related to not having permission to use the keyring… any ideas?

    I have gotten it to work by deleteing and recreating the network profile… this bring up the keyring access prompt.

    Also, repeating the “sudo touch” phase and rebooting has worked.

  26. This was helpful for my setup too: Ubuntu 8.10.
    The file /etc/network/interfaces must be empty
    except for the loopback. Otherwise gnome network
    manager cannot connect, gives not debug/output,
    removes/adds interfaces seemingly randomly, etc.


  28. Hey,

    I cannot go pass the step where I have to alter “/etc/default/wpasupplicant”

    I write: touch /etc/default/wpasupplicant

    but permission is denied. Then, I write: su gary (my username) and write in my password.

    When I try to write the command: touch /etc/default/wpasupplicant
    I am still denied permission!

    Any help would be appreciated

  29. Installed Ubuntu 8.10. After I figured out what the Network Manager is, I was able to get WPA-PSK working. I then ran an update (yes, silly me). After that, I crapped out and can’t get wifi a connection again no matter what. 🙁

  30. BTW: That’s a Dell Inspiron 3500, 256MB Ram. The wifi card is an SMCWCB-G (802.11g). Works great when it’s working.

  31. i deleted everything in the file where i was supposed to comment “lo”
    and saved it on accident. damn it. how do i fix this and is it fixable?

  32. when you say only “lo” entries in sudo gedit /etc/network/interfaces, is it right if i have the following in that file?
    “auto lo”
    “iface lo inet loopback”

    and after i go though the whole process i get an error saying
    “failed to initialize HAL” and i cant move my cursor
    can anyone help?

  33. Dell Vostro A90 resolved my issue with not being able to connect to my wireless network. The Vostro A90 (mini reincarnated) kept changing my passwork WPA phrase. No matter what I did it kept changing it to a long string of characters. I have to type the password but at least now I can connect. I don’t know what bug fix will remove this particular problem but this is at least a nice workaround to the issue. Dell Mini or Dell Vostro A90.

  34. Hey, thanks a lot! worked for me on Jaunty. I wasted hours trying to figure this out.

  35. Thanks a lot for this – for whatever reason, restarting dbus also fixed my monitor resolution issue I was having. Much nicer using the wizard than writing the wpa supplicant config file from scratch (and remembering how to do it!)

  36. im haveing a problem with this command

    sudo gedit /etc/network/interfaces
    I keep geting an error saying its not found i cant save the file without this command can you help me please

  37. Thank you very much for this, i’ve had this problem since forever.

    Now i’m ready to crossover to GNU/Linux without the Windows safety net.

  38. i have had problems since i downloaded the ubuntu 9.10 trying to get it connected and im a total newb to linux stuff im planning on going to college for network and admin so this is a god send for me i will try this thanks everyone who has studied this OS for some time i just heard about it last week thats how newb i am

  39. I dont know what to comment in the gedit
    what do you mean by “Comment out everything other than “lo” entries in that file and save the file”

    and where do i create the file?


  40. PLEASE HELP ME GUYS, i do so how you said but it doesn´t work. Did i do anything wrong? by start i see network is deactivated, than it going on but it is no conection! with the wpa supplicant paket it doesn´t works and so many tried. help me

  41. @ Jeronimo:

    “and where do i create the file?”

    If you read the directions you are using the command he gave you to edit a file that already exists, no creating anything. You comment out lines in a config or bash file by starting the line with the number symbol: #

    so this:
    echo complaints >/dev/null

    #echo complaints >dev/null

    You want to learn, you have to read carefully, search, then post.

  42. BOOMSHAKALAKA! Worked first time. Thanks. I was about to throw my PC from the roof of a tall building.

Leave a comment

Your email address will not be published. Required fields are marked *