I am a die hard fan of Ubuntua lot more better than Windows Operating System based on Linux – so much so that I have completely stopped using Windows in my PC long time back. Windows costs money and makes you pay for buying it, while Ubuntu is free and makes your life much much better after installing it.

Problem: Slow Wifi Speed in Ubuntu

Recently Ubuntu came out with its newest version 11.04 code named Natty Narwhal, and after upgrading my earlier 10.10 version Maverick to this new Version of Ubuntu, I faced my first real issue with Ubuntu in so many years – My USB Wireless Internet Connection speed had almost come to a standstill like a slow dial up connection after upgrading Ubuntu to 11.04! The connection was n times weaker than Windows based systems running on same wireless connection. Many a times it even simply dropped Internet connections.

And I was quite sure that the Upgrade to 11.04 was causing this issue, and that too only with my wireless connection. That was because, the upgrade which I downloaded which was more than a GB I guess was relatively very quick over my wireless connection and happened within a couple of hours. And when the wireless became dead slow after the upgrade, I did a check on the same connection using a normal Ethernet connection (a wire -full connection) and the speed with Ethernet was good as usual, only the wireless sucked.

I searched the entire Ubuntu documentation and forums, only to see that most people had the same problem after their upgrades, but none of the solutions posted there worked – not at least for me. I was going mad with my slow wireless Internet connection when I finally found this thread which said that it was the new Power Management settings in Ubuntu that were causing less power to be supplied to the wireless Internet device there by considerably slowing down the Internet speed in many wireless devices!

Solution to Slow Wifi in Ubuntu

And the solution? Well, that is the reason I wrote this post. The solution is to run the following command to turn off Power Management of your wireless device by Ubuntu, and instantly after running this command my wireless Internet gained Rocket speed!

Just open a Terminal window in Ubuntu and type

sudo iwconfig

This will list the available wireless interfaces in your system. Now check out your wireless device name here, usually it will be wlan0

Now type the command

sudo iwconfig wlan0 power off

What this essentially does is switch off the power management by Ubuntu for your wireless device. That’s it, and now trying to download a file or watching a Youtube video, and you will see that your wireless Internet connection is now back to top speed.

But this is only a temporary solution, because the next time your operating system starts, you will have to run this command again. So we actually need a permanent solution to forever prevent Ubuntu from handling the power management of our wireless device. How to get that done?

All we need to do is edit the file at the path /etc/pm/power.d/wireless – if this file or path does not exist, then you need to create it.

So cd to the directory /etc/pm/power.d and if this directory structure is not there then you need to create it using mkdir.

The create or edit the file called wireless in this folder using the following command in a terminal window

sudo pico /etc/pm/power.d/wireless

NOTE: I prefer pico to gedit, if you are more comfortable with gedit, then simply replace pico with gedit.

The above command opens the wireless file for editing as a root user.

In this file add the following lines and save the file and exit. That’s it.

#!/bin/sh
/sbin/iwconfig wlan0 power off

The above lines tell Ubuntu not to manage the power supply to the wlan0 wireless device. So even after you restart your system, Ubuntu will not control the power supply of your USB wireless device, and there you are your wireless internet speed back to normal forever or at least till you face another issue.

By the way, I also don’t like the new Unity interface in Ubuntu 11.04 and have reverted it back to the classic GNOME – don’t want my powerful PC to look like a small Notebook.

Update (Feb 21 2011)

Even though my wireless Internet connection gained back a significant amount of its original speed after applying the above fix, it still was not running at its peak speed and I continued to search for other solutions to bring back my wireless internet connection to full speed. And finally the below additional fix brought back my wireless connection to its top speed on par with my windows system. So here goes the solution.

There is a bug in the Debian Avahi daemon in Ubuntu. And to resolve this you need to edit the following file /etc/nsswitch.conf as follows.

Type the following in the command line

 sudo gedit /etc/nsswitch.conf

This will open the nsswitch.conf file in the text editor. Then simply change the following line

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

to the below line and save the file.

hosts:          files dns

That is it. Just reset your internet connection or probably restart your system and your wireless connection should be back on top speed. This worked for me like a charm.

213 COMMENTS

  1. Thanks I’ve been really bugged that Opera would report I’m on a slow connection when I have a 30 MB connection. Hoping this will fix it..

  2. Thanks I’ve been really bugged that Opera would report I’m on a slow connection when I have a 30 MB connection. Hoping this will fix it..

  3. Thank you very much ! You solved that ! Also try to update your post using the following phrase: Ubuntu wireless weaker than windows (because I was trying to search for that solution with the above phrase)

  4. Hey having a small problem: if I type in “iwconfig wlan0 power off” the prompt says operation not supported. what does this mean?

  5. Hey having a small problem: if I type in “iwconfig wlan0 power off” the prompt says operation not supported. what does this mean?

  6. I started having the same problem recently on my 10.10 Maverick install of Ubuntu, probably due to some recent updates. And the same workaround works, thanks a lot!

  7. Hey having a small problem: if I type in “iwconfig wlan0 power off” the prompt says operation not supported. what does this mean? having this problem too, please answer!

  8. Hey having a small problem: if I type in “iwconfig wlan0 power off” the prompt says operation not supported. what does this mean? having this problem too, please answer!

    • It means either the wireless device is not plugged in into your system or is recognized using a different name other than wlan0

      Did you find wlan0 listed when you entered the command “sudo iwconfig” in the terminal window? If there was some other term used for the wireless device then you need to replace wlan0 with that term.

  9. Thanks for the great tutorial. It did help my speed issue, as well as updating the kernel. But, it didn’t work at first until
    I followed the thread you listed and found that I needed to change the permissions to allow it to run as as an executable. After that, all is well.
    And, I agree with you on Unity. I found it cumbersome and hard to navigate to my common programs/files. I reverted back to Gnome classic.
    Much better!!

  10. Thanks for the great tutorial. It did help my speed issue, as well as updating the kernel. But, it didn’t work at first until
    I followed the thread you listed and found that I needed to change the permissions to allow it to run as as an executable. After that, all is well.
    And, I agree with you on Unity. I found it cumbersome and hard to navigate to my common programs/files. I reverted back to Gnome classic.
    Much better!!

  11. Thank you so much. That was such a big help. Interesting that such a simple item like power manger could be cause.

    Thanks again.

  12. Thank you so much. That was such a big help. Interesting that such a simple item like power manger could be cause.

    Thanks again.

  13. Thank you, i feel my connection is better now, but I have a question… it’s not supposed that when I use iwconfig it must show “power management: off”? Because that’s my case.

  14. Thank you, i feel my connection is better now, but I have a question… it’s not supposed that when I use iwconfig it must show “power management: off”? Because that’s my case.

  15. Thank you, i feel my connection is better now, but I have a question… it’s not supposed that when I use iwconfig it must show “power management: off”? Because that’s my case.

  16. Thank you, i feel my connection is better now, but I have a question… it’s not supposed that when I use iwconfig it must show “power management: off”? Because that’s my case.

  17. ok please somebody tell me how to fix this, i typed in “sudo iwconfig wlan0 power off” and it says operation not supported

  18. ok please somebody tell me how to fix this, i typed in “sudo iwconfig wlan0 power off” and it says operation not supported

    • Just type iwconfig and see whether it lists wlan0, most probably yours has a different name in place of wlan0 – just replace wlan0 with that and run the above command

  19. how do you actually save and exit after you have created the file ? I am new to ubuntu and dont have a clue. I tried typing save and exit in the terminal but it done nothing, so i just turned the PC off. What do i do to save it so the power management stays permanently off ?

    • If you are using the following command (pico) to edit the document
      sudo pico /etc/pm/power.d/wireless

      Just do a Ctrl X after completing the edits, which will make the editor quit which in turn will prompt you to save the changes before quitting. Then pressing “Y” will save the changes and quit the editor.

  20. I think its made my internet respond a little tiny bit quicker, still on speedtests i’m only getting 2 megs download on a 8 meg connection (that works fine with vista on the same machine). Would love to get this sorted as im really digging ubuntu (downloaded it yesterday) 

    • Same here, I thought it was some problem with my system till I realized that booting into windows in the same system didnt have any internet speed issue. Hence after finding a solution posted it so that atleast others dont get frustrated as I got. Good to hear others benefiting from it 🙂

  21. I am using Huawei USB Modem Mobile Broadband. Is “sudo iwconfig” is applicable for this. What I get after issuing command is
    lo        no wireless extensions.
    eth0      no wireless extensions.
    ppp0      no wireless extensions

    Although slow But I am using it to connect to the net.

  22. I am using Huawei USB Modem Mobile Broadband. Is “sudo iwconfig” is applicable for this. What I get after issuing command is
    lo        no wireless extensions.
    eth0      no wireless extensions.
    ppp0      no wireless extensions

    Although slow But I am using it to connect to the net.

    • Looks like your USB device was not connected to the internet when you ran the command? Since yours is a mobile broadband, the device would be ppp0. So the command you need to run is

      sudo iwconfig ppp0 power off

      • 1. I was connected to internet when I ran “sudo iwconfig” command. When not connected this command gives 1st two lines.
               i.e. “ppp0  no  wireless extensions” is absent.2.  running “sudo iwconfig ppp0 power off” gives following          Error for wireless request “Set Power Management” (8B2C) :         SET failed on device ppp0 ; Invalid argument.
        3.  lsusb shows Moem to be connected at Bus 001 Device 005

  23. Need help. My wireless device name is wlan0. But when I type “sudo iwconfig wlan0 power off”, I get the response:

    Error for wireless request “Set Power Management” (8B2C) :    SET failed on device wlan0 ; Operation not supported.

    and nothing changes. My internet is still horrible. 

    What do I do to fix this and get my internet working again?

  24. Need help. My wireless device name is wlan0. But when I type “sudo iwconfig wlan0 power off”, I get the response:

    Error for wireless request “Set Power Management” (8B2C) :    SET failed on device wlan0 ; Operation not supported.

    and nothing changes. My internet is still horrible. 

    What do I do to fix this and get my internet working again?

  25. Thank you for this fix, but why do you disallow copying from your blog? It’s annoying that I have to rewrite each and every command line.

  26. Thank you for this fix, but why do you disallow copying from your blog? It’s annoying that I have to rewrite each and every command line.

    • Sorry about that. Copying is not disallowed. Its only appending a credit to the original link, just in case somebody misses it out 🙂

  27. Hi I’ve just downloaded ubuntu for the first time and am having this slow internet connection problem that many people seem to have had.  I’ve disabled the power manager in the terminal, but didn’t really notice any change.  Web browsing is still horrendously slow.  Also I’ve noticed that the power manager has stayed off even after I re-booted.  Is there anything else I should try?

  28. wow.. my connection issues seems to have been solved.. will do some more rigorous testing and get back.. but so far looks great! Thanks!

  29. wow.. my connection issues seems to have been solved.. will do some more rigorous testing and get back.. but so far looks great! Thanks!

  30. Dear all, l am new to ubuntu and first downloaded the new 11.10. After my wireless internet speed was extremely low and after some research l decided to try 11.04 – with somewhat of success. However, my internet speed will fluctuate from extremely slow to great. Other non ubuntu machines running on the same wireless network will be just fine. It also seems random when it will be fast and when it will be slow (and the connection icon in ubuntu is always showing full connection). 
    l tried to turn off power management but when l was running iwconfig the wlan0 already list the power management as off (and l’m not able to run the rest of the script which l’m guessing is because the power management is already off).l’ve also tried the other  wireless usb adapter l’m running on my second htpc (running xp) and this has the same issues on the ubuntu machine yet non of the two usb adapters are running slow when used on the xp machine. Any help would be appreciated.Thanks

  31. Need help. My wireless device name is wlan0. But when I type “sudo iwconfig wlan0 power off”, I get the response:Error for wireless request “Set Power Management” (8B2C) :    SET failed on device wlan0 ; Operation not supported.and nothing changes. My internet is still horrible. What do I do to fix this and get my internet working again?

  32. Need help. My wireless device name is wlan0. But when I type “sudo iwconfig wlan0 power off”, I get the response:Error for wireless request “Set Power Management” (8B2C) :    SET failed on device wlan0 ; Operation not supported.and nothing changes. My internet is still horrible. What do I do to fix this and get my internet working again?

  33. thanks a lot bro!!! i was really pissed of with wireless speed.. ur post has solved the problem!!! i m also in favour of ubuntu so i really wanted to get rid of this problem!!! really thanks for helping!!!

  34. I am having the same problem in 11.04 it Internet Speed is between 8Kbits to 20kbits and it dips to zero often. So I wipe the Hard drive clean re-install the 11.04 and worked fine. Only for problem to return in few hours. So I wiped it clean again. ( Isn’t this cools you can do because of Ubuntu One account) And re-installed 11.04 and speed was good. So I upgraded to 11.10 and it only too me 4 hours to do a complete upgrade which is good at 54Mbit speed. And I was able to use 11.10 fine until I downloaded Android Sdk. It seems that once download is started. either ISP has got a way to filter GID of the machine that consist of non-windows and non-mac Machines and put it on Slow Internet. If they do not have a business account.
    Anybody thing this may be a possibility. ?

    • Did you try downloading something else, like watching a youtube video? Just to make sure that it is Ubuntu issue or only Android download issue?

      • Yes Youtube vedios are slow as well But I can run the browser just fine.. Its only the download speed for streaming or data transfer that is slow. So it gives me reason to believe ISP may be rationing download only. But then it does not happen on XP machine I can download just fine.

  35. Perfect, thank you very much! I just used this on Mint 12 KDE RC and it worked perfect. I got an initial error when trying to shut off power control with the Konsole but after saving the file and rebooting it was great.

  36. Perfect, thank you very much! I just used this on Mint 12 KDE RC and it worked perfect. I got an initial error when trying to shut off power control with the Konsole but after saving the file and rebooting it was great.

  37. Thank you so much!  I’m a Ubuntu newbie, and I was worried that the OS was somehow crippled because the internet connection was so slow.  This fixed it!  I’m a big Ubuntu fan again!

  38. I got an error “Error for wireless request “Set Power Management” (8B2C) :
        SET failed on device wlan0 ; Operation not supported.” 🙁 any solutions?

  39. I got an error “Error for wireless request “Set Power Management” (8B2C) :
        SET failed on device wlan0 ; Operation not supported.” 🙁 any solutions?

  40. I am very new to Ubuntu , my terminal shows below comment , anybody can help me ?

    inaya@binaya-HP-Pavilion-dv2000-GG176PA-ABG:~$ sudo iwconfig
    [sudo] password for binaya:
    lo        no wireless extensions.

    eth0      no wireless extensions.

    wlan0     IEEE 802.11abg  ESSID:”BPNetwork”  
              Mode:Managed  Frequency:2.462 GHz  Access Point: 00:24:D2:9A:E7:65   
              Bit Rate=54 Mb/s   Tx-Power=14 dBm   
              Retry  long limit:7   RTS thr:off   Fragment thr:off
              Encryption key:off
              Power Management:off
              Link Quality=46/70  Signal level=-64 dBm  
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:1  Invalid misc:2119   Missed beacon:0

  41. For some reason I can turn it off, but I can not make it persistent. Made the file executable, but every time I reboot it’s turned on again. I’m on a desktop. Any ideas?

  42. For some reason I can turn it off, but I can not make it persistent. Made the file executable, but every time I reboot it’s turned on again. I’m on a desktop. Any ideas?

  43. Hi everyone. I’m using an Asus u56e-bal7. Super Ubuntu 11.04 fresh install. I tried a buttload of commands and things (disabling n, disabling ipv6 on wifi & firefox, disabling power management). I don’t know if some of them put together plus the following worked, but this is the final step that worked for me…

    Kernel 2.6.39 completely fixed the issues with the ath9x driver for me in 11.04 (Natty). I can do high-load transfers without issue. Comment #8 on “wlan (AR928X, ath9k) slow since upgrade to natty” contains instructions on how to get this kernel from a PPA. I did an apt-get install rather than a dist-upgrade, but either one should get you the new kernel. Here’s what I did:

    sudo add-apt-repository ppa:kernel-ppa/ppa
    sudo apt-get update && sudo apt-get install linux-generic-pae

    If you’re using a 64-bit kernel, I think the package to install is just “linux-generic”. Or just follow the instructions right in the bug (use apt-get dist-upgrade -y).

    Also possibly related:

        UNR Ath9K unstable connection
    https://bugs.launchpad.net/ubuntu/ source/linux/ bug/378156

    After upgrading to linux 2.6.39, changing the ath9k driver config (as suggested in Why is my internet so slow with an Atheros wireless card?) is not necessary.

    Hope this helps!

    I forget where it’s from…

  44.  Correction…ChickenMusket here again…this final step worked (after all the others & maybe all the others were unnecessary). Went into wireless connections, the edited the one I’m currently using. Edited the ipv4 settings Method: automatic (dhcp) address only. And in the dns server field I specified the ip address of my gateway wireless router. Basically, you want to specify a dns server here: the one that tests the fastest for you. If you don’t know what it is, use this website’s app to find it. http://www.grc.com/dns/benchmark.htm. I wasn’t able to run it in linux, but I ran it in a virtual box windows 7 machine (bridged to my linux wifi interface). Sort it by fastest. My two fastest dns turned out to be the wireless router ip address & the modem in my LAN.

  45.  Correction…ChickenMusket here again…this final step worked (after all the others & maybe all the others were unnecessary). Went into wireless connections, the edited the one I’m currently using. Edited the ipv4 settings Method: automatic (dhcp) address only. And in the dns server field I specified the ip address of my gateway wireless router. Basically, you want to specify a dns server here: the one that tests the fastest for you. If you don’t know what it is, use this website’s app to find it. http://www.grc.com/dns/benchmark.htm. I wasn’t able to run it in linux, but I ran it in a virtual box windows 7 machine (bridged to my linux wifi interface). Sort it by fastest. My two fastest dns turned out to be the wireless router ip address & the modem in my LAN.

  46. Very informative n really very effective…. i had been facing this issue for a very long time n even after some rigorous search on internet couldnt find the result to this bug… bt this article really helped resolving the issue… thanks to the author!!!! cheers!!! 😉

  47. Very informative n really very effective…. i had been facing this issue for a very long time n even after some rigorous search on internet couldnt find the result to this bug… bt this article really helped resolving the issue… thanks to the author!!!! cheers!!! 😉

  48. Thank you, thank you, thank you, thank you!!! After hours of searching, your article finally helped me fix the problem in Ubuntu 12.04. I was almost ready to go back to Windows. They should really include this fix in their next update. Before the fix, my speeds would get down to dial-up speeds (literally). Now, I’m back up to 1.1Mbps.

  49. Thank you Thank you Thank you. I am reinvesting the majority of my time away from windows “X” back to a few of my favorite linux distros. This is the reason why I love the linux community. Appreciate the help and the time you took. Have a happy new year.

  50. Thank you Thank you Thank you. I am reinvesting the majority of my time away from windows “X” back to a few of my favorite linux distros. This is the reason why I love the linux community. Appreciate the help and the time you took. Have a happy new year.

  51. sudo iwconfig wlan0 power off give me:

    Error for wireless request “Set Power Management” (8B2C) :

    SET failed on device wlan0 ; Operation not supported.

    Is there anything wrong?

  52. sudo iwconfig wlan0 power off give me:

    Error for wireless request “Set Power Management” (8B2C) :

    SET failed on device wlan0 ; Operation not supported.

    Is there anything wrong?

  53. You’re update from Feb 21 2011 put my machine to the point where it wouldn’t load any webpages at all. The other solution did not speed it up at all. Running ubuntu 12.10

  54. Thank you! just installed Ubuntu12.10 for the very first time, and I noticed the drop in speeds.. From a brand new Ubuntu newb.. THANK YOU!

    • The power management system in Ubuntu for the wireless device had an issue which caused less power to be supplied to the device slowing down the connection speed. Turning it off fixes the issue if that is the reason for the slow connection.

  55. thank you! what a simple solution. and to know that I have been frustrated for the past 2 months unable to find a solution after updating ubuntu.

  56. I don’t use Ubuntu, but I just tried this on Manjaro and it seems to be working. I entered the command you mentioned and my internet speed is fine now. I also created the wireless file, so hopefully my internet will continue to work properly after I restart my computer.

  57. I was going to throw away my WUSB54G v4 but you came along and saved the day for me. Thank you ever so much! (Running successfully on Linux Mint 17.1)

  58. I was going to throw away my WUSB54G v4 but you came along and saved the day for me. Thank you ever so much! (Running successfully on Linux Mint 17.1)

  59. I didn’t have wlan0 as my wirless device – infact it showed no wireless device! I had started to hate Ubuntu but then I tried the second method and it worked like a charm! Thanks a lot! 😀

  60. Thanks!! -You’re a life saver I can’t understand who makers of such great OS make such noob mistakes sometimes.
    ————————

    This will open the nsswitch.conf file in the text editor. Then simply change the following line

    hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

    to the below line and save the file.

    hosts: files dns

    That is it. Just reset your internet connection or probably restart
    your system and your wireless connection should be back on top speed.
    This worked for me like a charm.

  61. Thanks!! -You’re a life saver I can’t understand who makers of such great OS make such noob mistakes sometimes.
    ————————

    This will open the nsswitch.conf file in the text editor. Then simply change the following line

    hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

    to the below line and save the file.

    hosts: files dns

    That is it. Just reset your internet connection or probably restart
    your system and your wireless connection should be back on top speed.
    This worked for me like a charm.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.