Ralink rt5390 wi-fi driver on ubuntu 11.04

UPDATE (7-Feb-2012): Marko has created a PPA for the Ralink drivers. I should make our live much easier. Take a look at his blog (http://www.techytalk.info/ralink-wireless/).

I have HP pavilion dm1z laptop and it took me quite some time to install the linux wi-fi driver on ubuntu. In this post I tell how to install the Ralink’s RT5390 wi-fi driver on Ubuntu Natty Narwhal. The main source of the post is Ubuntu forums. So here it goes.

  1. Download the linux driver (RT5390PCIe) from Ralink.
  2. Extract it.  The files will be extracted to 2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO folder.
  3. Download all the patches except the x64_86 patch, assuming you have a 32-bit system, from opensuse website.
  4. Copy the patches to the folder – 2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO
  5. Goto the folder.
  6. Make the following change in  /os/linux/config.mk file – HAS_ANTENNA_DIVERSITY_SUPPORT=y (originally was n)
  7. Now run the following commands in terminal:
    patch -p0 < rt5390sta-
    patch -p0 < rt5390sta-
    patch -p0 < rt5390sta-
    patch -p0 < rt5390sta-
    patch -p0 < rt5390sta-
    patch -p0 < rt5390sta-
    sudo su
    cp RT2860STA.dat RT5390STA.dat
    mkdir -p /etc/Wireless/RT5390STA
    cp RT5390STA.dat /etc/Wireless/RT5390STA
    make clean
    make install
    modprobe rt5390sta

Link to the original posts on ubuntu forum: Points 3 and 7 are from Chilli555’s post #24, while others are from Akshay’s post.

UPDATE: It has been pointed out by Weldon in the comment section that the above method does not work for Kernels >=2.6.39. To know your kernel version you can type the following in terminal:
uname -r

UPDATE (5-Aug-2011):

  1. kpbotbot has confirmed that he can run wireless on kernel >=2.6.39 using an arch Linux fix available here.
  2. Ralink has changed the driver available. I old driver can got from here.
  3. The opensuse link above now points to new set patches. The old ones can be downloaded from here. You can try using the new version but I have not used it so cannot say much about it.

UPDATE (2-Sep-2011):

  1. kpbobot has pointed out in the comment section that the drivers are already a part of Linux 3.x kernel.



      1. Hi Guys,
        I been having the problem with the multi-touch pad. Have you people been able to fix that? I want my touch pad to work as a normal touchpad. No multitouch or gestures in ubuntu.

  1. Shishir……..you are the man. After several hours and several attempts success at last. Thank you.

  2. Hi!
    Thanks a lot… seems to work!
    I only had some problems with…
    patch -p0 < rt5390sta-…

    it said… ASSUME -R [n]… what does it mean?

    Nice greetings from Bavaria!

    1. Alex,

      Assume -R means to assume that each patch ‘hunk’ is “R”eversed.

      You can read more by typing “man patch” at the command line. (“man” is short for “manual”)

  3. Thanks for this; I’d been following the steps for 10.10 (I’m on 11.04) and reception on my home wifi network had been very spotty. I decided to start from scratch following your steps and they worked brilliantly. Pretty much all was the same except the addition of modprobe. Thanks a ton.

  4. I have done everything step by step but at terminal in most lines says “no such file or directory”.
    For example :
    nickotoka@ubuntu:~$ patch -p0 < rt5390sta-
    bash: rt5390sta- No such file or directory

    What i have done wrong? In which directory the folder must be? I have it at "Home/nickotoka/Downloads"

    I'm new into this so if someone can help please guide me.


    1. You must copy all the patches to the folder – ‘2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO’.

      1. I’m having the exact same problems. Followed directions verbatim, and copied all of the patches. I am also getting the No such file or directory problem

  5. I tried to follow your tutorial and found that the patches are no longer available on the suse web page, any suggestions

  6. Error make 😦

    /home/peter/driver/2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO/os/linux/../../os/linux/cfg80211.c:1388:2: warning: initialization from incompatible pointer type
    make[2]: *** [/home/peter/driver/2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO/os/linux/../../os/linux/cfg80211.o] Error 1
    make[1]: *** [_module_/home/peter/driver/2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO/os/linux] Error 2

    If i changeHAS_CFG80211_SUPPORT=y
    to n
    driver working but not good.

  7. Hi Peter, I don’t much about the technical stuff. I would suggest that you look for answers at ubuntu forums.

  8. I did everything you said. but when i get to the terminal part i type in the first line: patch -p0 < rt5390sta- , and I get: patch -p0 < rt5390sta-
    I DO have all the patches in the 2010 folder. what do I do? oh and I am a total newbie when it comes to linux. I have HP pavilion g6, ubuntu 11.04 PLEASE HELP!

  9. As a caveat, this stops working for Kernels >= 2.6.39 because the function frequency_to_channel changes its signature; if I get a patch working I’ll post it.

    1. Ah, is that what happened? I’ve been having to choose an older version of the kernel from my grub startup menu, and was wondering why. Thanks for the clarification.

    2. That explains why these instructions never worked for me. I was able to load the modules and bring up the interfaces, but it never found networks. If 2.6.39 is the problem, I’d be better of staying on Windows until this gets “fixed”. Either I use Windows or Linux 2.6.33 xD

      TIA 😀

      Btw, I’m trying these instructions on Arch.

  10. Hey guys, I get the same as Nicko, i.e.

    bash: rt5390sta- No such file or directory

    I’m clearly missing some crucial steps. I have extracted the files, moved the folder onto my desktop, put all the patches in it, started the terminal, and failed on the firs command. Please help. Am I not in the right directory in terminal? How exactly do I do this?

    Oh, and I cant find the HAS_ANTENNA_DIVERSITY_SUPPORT line in the config.mk file. What’s with that?


    1. The patches have been updated to a newer version. And I just checked the config.mk file it does not have the HAS_ANTENNA.. option any more.
      You can get the older patches from here:

      I duno how to use the new patches but will update when I know it. Also, you can try the link by kpbotbot on arch linux site:
      I haven’t used it so I can’t say much about it.

  11. Hey, I am new to ubuntu I’m running 11.04 trying to get this work but everything seems to be updated and i keep getting errors any help please?

    1. Hi, you are right all this things have been updated. I am not sure how to make things work with the updates. I suggest that you ask the question at ubuntu forums.

  12. Hi
    Okay, so thank you very much for this guide! It was very confusing at first, since all the links were different and the drivers and patches were no longer the same, but I eventually got it working.
    However, after being online for some time I was asked if I wanted to upgrade ubuntu, which I did. After doing so, and restarting my computer, the problem was there again. I upgraded from 2.6.38-8-generic to 2.6.38-11-generic, I think (I am as big of a linux-noob as they come). What should I do?
    Right now I chose 2.6.38-8-generic while booting instead of the newer version, and this works fine. I guess its not too much of a hassle to pick this instead of the other one, but if there is a solution then I would love to hear it!
    Does anyone know what might be the problem?

    1. Hi Frode
      I have not been using my laptop for quite sometime. So, I am not aware of the latest technical issues of using the ralink wireless card in Ubuntu.

    2. Do the steps again (reinstall the drivers). Everytime the kernel gets upgrade, the kernel modules need to be reinstalled.

      However, if you can somehow get the newest kernel (Linux 3.x), do so since the wireless drivers are already part of the kernel. No need to manually reinstall the modules 🙂

  13. Thanks for sharing your work
    It works fine on my HP DM1 Ubuntu 11.04. I’ve done all the instructions. I’ve ony change by and every thinks go well.

  14. Heya,

    So I followed all the steps and I suppose it worked. However, when I do a “iwconfig” check, it still does not recognize my wireless card. It comes up as:

    lo no wireless extensions.

    eth0 no wireless extensions.

    Am I missing something? Aren’t the steps here designed to ensure that the wifi card is detected?

      1. Hi Daimon
        It should show the wireless card. But I am not very sure as I am not using my laptop these days so I cannot check it. Also, I think you should try Ubuntu 11.10 beta (live version first) because it uses the Linux 3.x kernel which ‘kpbotbot’ points out that it has the drivers built in.

  15. When I Try to make it gives the following error

    [root@localhost 2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO]# make
    make -C tools
    make[1]: Entering directory `/home/rahul/Downloads/2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO/tools’
    gcc -g bin2h.c -o bin2h
    make[1]: gcc: Command not found
    make[1]: *** [all] Error 127
    make[1]: Leaving directory `/home/rahul/Downloads/2010_1216_RT5390_LinuxSTA_V2.4.0.4_WiFiBTCombo_DPO/tools’
    make: *** [build_tools] Error 2

    Any Suggestions would be of great Help !

  16. When i try this i downloaded the drivers no problem. But when i try patches it says “Patch not installed” .. My wifi card is Rt5390 in HP G62 Notebook.. Thx

  17. everyone if you get errors make sure gcc is installed and updated. also make sure you have su permissions. you have to work within the same directories or point to certain directories. hope this helps some people!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s