Brother Scanner Driver Installation in Ubuntu 9.10 (Updated)

UPDATE (03/15/2011): According to the comments posted by two readers, Ludovic and Don1, the snippet in this post also applies to Ubuntu 10.10 (Maverick Meerkat), but make sure to change “SYSFS” to “ATTRS”. For the original snippet, read the post below. Note that I’m still using Ubuntu 10.04 because there’s no WebDAV support even with the upcoming 11.04, so I can’t verify the code myself. For the original comments, scroll down to the comments section of this post.

UPDATE (08/31/2010): The solution in this post appears to only work in Ubuntu 9.10. I haven’t have any success with the scanner running in non-root environment since I upgraded to 10.04. This bug however is not very popular. Its launchpad page can be found here.

UPDATE (07/08/2010): Changed the last line to single equal sign. It doesn’t work with the double equal signs. Check out the updated post below for more detail.

UPDATE (05/01/2010): I recently discovered that I can use wild-card characters such as * and ? in the command line to easily find and execute/edit the file. See step 5 of this post for more information about how to use these special characters to find the libsane.rules file.

I haven’t used my Brother-based multifunction printer since I switched to Ubuntu. When I need to use the scanner function of my MFC-7420 printer to scan a document, I just found out that I have to install this printer and its scanner driver. I was surprised to know that there are already drivers for my Brother printer available in the repository and waiting to be installed. I installed the printer driver and downloaded the scanner driver for my printer device from the Brother website.

After I installed the scanner driver, I thought that it should automatically detect scanner by Ubuntu. However, it didn’t detect my scanner at all during the starting of the XSane Image Scanner. I then tried to run it through the root account and the program detected the scanner without problem.

I decided to find a way to use the scanner under non-root account. After I searched around online, I found out a post from Ubuntu forum that discusses about the same issue. Unfortunately, it is for the older version of Ubuntu. While following the tutorial and digging around, I discovered that the location of libsane rules file is different from the tutorial, as well as the format of the rules. After I looked through this tutorial, I revised it to fit the version of Ubuntu that I currently installed which is the stable version 9.10:

  1. Download the Linux driver for your scanner from Brother Linux driver download page (.deb is for Debian-based distros, and .rpm is for Fedora-based distros).
  2. Download the appropriate packages and install them to your system.
  3. Open up the terminal and type lsusb command into the command line to see a list of USB devices that have connected to your system.
  4. Record the Vendor ID and Product ID of your Brother device from the list, the following is the sample format of the list (the basic format is Vendor-ID:Product-ID):

    Bus 001 Device 003: ID 04f9:018c Brother Industries, Ltd

  5. Using either Vim or gedit to open /lib/udev/rules.d/40-libsane.rules file as root.

    NOTE: The number in front of the libsane.rules might not be 40, so please check with the content inside /lib/udev/rules.d directory using the command ls /lib/udev/rules.d and look for the libsane file.

    UPDATE: Or you could simply enter vim /lib/udev/rules.d/*libsane* or gedit /lib/udev/rules.d/*libsane* into the command line.

  6. After the file is opened, you need to add the following lines before the last comment (at the bottom part of the file):

    # Brother “Your scanner module

    SYSFS{idVendor}==”Vendor ID“, SYSFS{idProduct}==”Product ID“, ENV{libsane_matched}=”yes”

    Update (07/08 2010): I changed the last line to ENV{libsane_matched}=”yes”. It doesn’t work with the double equal signs.

    Replace “Your scanner module” with your scanner module number (without quote, for example: MFC-7420) and replace “Vendor ID” and “Product ID” with the Vendor ID and Product ID that you recorded earlier (with quotes for both fields, for example: “04f9″ for Vendor ID and “018c” for Product ID).

  7. Finally restart your system and XSane Image Scanner and other programs that using Sane should detect the scanner with normal user account.

If you have any problem after completing the above steps, please leave a comment below. I will help you as possible as I can.

  • Robert

    I don’t have the file /lib/udev/rules.d/40 libsane..
    Do I need to create the file???
    Here is the directory:ls /lib/udev/rules.d
    40-alsa.rules 61-persistent-storage-edd.rules
    40-hplip.rules 62-bluez-hid2hci.rules
    40-ia64.rules 64-device-mapper.rules
    40-infiniband.rules 65-dmsetup.rules
    40-isdn.rules 75-cd-aliases-generator.rules
    40-libpisock9.rules 75-persistent-net-generator.rules
    40-pilot-links.rules 77-nm-probe-modem-capabilities.rules
    40-ppc.rules 79-fstab_import.rules
    40-xserver-xorg-input-wacom.rules 80-drivers.rules
    40-zaptel.rules 85-alsa-utils.rules
    45-fuse.rules 85-brltty.rules
    45-libmtp8.rules 85-hdparm.rules
    50-firmware.rules 85-hplj10xx.rules
    50-udev-default.rules 85-hwclock.rules
    60-cdrom_id.rules 85-ifupdown.rules
    60-persistent-input.rules 85-pcmcia.rules
    60-persistent-serial.rules 85-regulatory.rules
    60-persistent-storage.rules 90-hal.rules
    60-persistent-storage-tape.rules 95-udev-late.rules
    60-persistent-v4l.rules README

    • Robby Chen

      According to my libsane.rules file, it is created by sane-backends. This file will not be automatically generated if libsane is not installed on the system. Below is the beginning lines for the file for your reference:

      # This file was automatically created based on description files (*.desc)
      # by sane-desc 3.5 from sane-backends 1.0.20 on Thu Apr 15 07:24:47 2010
      # udev rules file for supported USB devices

      I don’t own an wireless scanner so I can’t guarantee it will work since it is for the USB scanners.

      Good luck!

  • Robert

    My Ubuntu version is 9.04. I recently purchased a HP 4500 wireless all in one printer and I was successful in getting the printer, fax and copy portion of it to work. But when I open x-sane it does not find my scanner and after searching for answers your post seem the closest..

  • Antonio Fiorentino

    I purchased an MFC-7840W Brother and run into the same problem with the scanner. I guess we need to be patient. Congratulations on the excellent job you do. I think you will have a bright future here in the US or anywhere. I have seen video of Shanghai and it is simply amazing what the Chinese people are building. It won’t be long before China achieves primacy on this planet – well deserved by the hard work of its peoples.

    Antonio Fiorentino

  • Ludovic

    On Maverick, the syntax has changed slightly. I wrote this for my DCP 7025:

    # Brother DCP
    ATTRS{idVendor}==”04f9″, ATTRS{idProduct}==”0184″, ENV{libsane_matched}=”yes”

  • Mold Removal

    I wanted to thank you for this interesting I definitely loved every little bit of it.

  • Don1

    Thanks Heaps Robby
    worked for me ubuntu 10.10 brother mfc-5440cn
    # Brother scanners
    ATTRS{idVendor}==”04f9″, ATTRS{idProduct}==”016d”, ENV{libsane_matched}=”yes”

  • Roy

    You da man

  • Ljfurlong

    “I then tried to run it through the root account and the program detected the scanner without problem.”

    I am a newbie with an MFC-7420 and 10.10 (soon 11.04). I have no idea how to achieve what you did in the quote above. How do I run Xsane through the root account?

    As for the rest of it, I’m gonna give it a whirl now.

    • Robby

      Hi, each command you want to run as the root account needs to add “sudo” in front of the command. For example, in the terminal, type “sudo xsane” to run xsane as root. If you have any question, don’t be afraid to ask me by replying this comment.

  • Ljfurlong

    I’m back. I found the libsane.rules file, but the gedit command results in a read-only environment, while the Vim command results in a flash of a warning in angry red letters. Any thoughts?

    • Robby

      Hi, files which are outside of your home directory needs to be edited as root. As I stated above, in order to edit these files as root, you need to add “sudo” in front of the command you want to execute. For example, if you want to edit the file using gedit, you type “sudo gedit libsane.rules”, press enter, and enter the password for your account. After that, you can edit the file and save it. The vim method is the same except you replace gedit with vim, “sudo vim libsane.rules”. By the way, vi and vim are the same command in Ubuntu. If you have any questions, please reply this comment.

      • Ljfurlong

        Hi, Mr. Chen. Everything is working fine now. Thanks for reminding me of the importance of “sudo”. You’ve been very helpful.