# [Solved] How To Install Brother HL-2040

## bdm

So I have a Brother HL-2040 printer, but don't really know where to start on installing it. I've search Google and the Gentoo-Wiki, but can't seem to find the proper documentation.

Any help is greatly appreciated.

Thanks!Last edited by bdm on Mon Oct 23, 2006 3:42 pm; edited 1 time in total

----------

## NeddySeagoon

Glass Casket,

From what I can see, you have a good chance of getting your printer working with  CUPS and the driver  here

First install CUPS, following the first link. Don't do the 

```
cat test>/dev...
```

part way through. It won' work for you. After CUPS in installed, you can find some drivers for other distros at the second link. I would choose the RedHat one. There are probably install instructions on that site somewhere because they are not in the file.

----------

## bdm

I installed CUPS, and it prints, but it only prints blank pages, lol  :Razz: 

----------

## NeddySeagoon

Glass Casket,

Thats a start - you now need the CUPS wrapper from the Brother website

----------

## bdm

I don't know if it's just me, but the RPM package just dosen't seem to want to install :S

----------

## NeddySeagoon

Glass Casket,

You cannot install an RPM directly on Gentoo, You have to take it apart and install the bits by hand.

There are only two files in the package - I didn't look like a proper RMP. If the filename ends in RPM, try rpm2targz to make it more manageable.  emerge rpm2targz if neded.

This will give you a fille called cupswrapperHL2040-1.0.0-1.i386.tar.gz which you unpack with 

```
tar -xzvf cupswrapperHL2040-1.0.0-1.i386.tar.gz
```

This gives you two files in the tree 

```
./

./usr/

./usr/local/

./usr/local/Brother/

./usr/local/Brother/cupswrapper/

./usr/local/Brother/cupswrapper/brcupsconfig2

./usr/local/Brother/cupswrapper/cupswrapperHL2040-1.0.0
```

You can install them like that and tell Gentoo how to find them or put them where Gentoo expects to fine them.

----------

## denials

This was much trickier than it should have been, but it's now working here. I'm assuming you already have a working CUPS installation and that usblp support is either built into your kernel or loaded as a module.

1. emerge rpm2targz

2. Download both brhl2040lpr-1.1.2-2.i386.rpm and cupswrapperHL2040-1.0.0-1.i386.rpm from the Brother Web site. They're in the Downloads -> Drivers -> Monochrome laser -> Linux section of the site.

3. Convert both RPM files to tarballs using rpm2targz, then extract the tarballs:

```

$ rpm2targz brhl2040lpr-1.1.2-2.i386.rpm

$ rpm2targz cupswrapperHL2040-1.0.0-1.i386.rpm

$ tar xzf cupswrapperHL2040-1.0.0-1.i386.tar.gz

$ tar xzf brhl2040lpr-1.1.2-2.i386.tar.gz

```

This creates a usr and a var directory in your current working directory.

4. As root, copy all of the files that were extracted into the usr directory into the corresponding directories in /usr/.

```

# cp usr/bin/brprintconflsr /usr/bin/.

# cp usr/lib/libbrcomplpr.so /usr/lib/.

# mv usr/local/Brother /usr/local/.

```

5. Modify the /usr/local/Brother/cupswrapper/cupswrapperHL2040-1.0.0 script to point to /etc/init.d/cupsd instead of /etc/init.d/cups; this change is required in three locations in this file.

6. Run the /usr/local/Brother/cupswrapper/cupswrapperHL2040-1.0.0 script to set up the Brother HL2040 laser.

7. Create a symbolic link from /usr/local/Brother/inf/brHL2040rc to /usr/local/Brother/inf/brPrintList.

```

cd /usr/local/Brother/inf

ln -sf brHL2040rc brPrintList

```

8. The printer defaults to A4 sized paper; if you're in North America you probably want to open /usr/local/Brother/inf/brHL2040rc in an editor and set PaperType=Letter.

9. Fire up the CUPS administration console (http://localhost:631 just might work); your Brother HL-2040 should be listed, and you should be able to print a test page. Yay!

Dan

----------

## benster

Wonderful, thank you denials! I had myself just gotten to the CUPS step after having installed, but never got the darn thing to print. A couple notes:

for step (5), I found no entries in the /usr/local/Brother/cupswrapper/cupswrapperHL2040-1.0.0 file that needed changing to /etc/init.d/cupsd; the entries I saw were already that way...   :Question: 

The only thing I didn't remember doing when I tried setting up the printer a few months back was setting up the symbolic link, so if I had to make a wager, then it would be the creation of the symlink that made it work.

Muchos Gracias for figuring it out.   :Very Happy: 

----------

## Lafe

I just wanted to add a note of thanks to you Denials!  It worked great for me as well.  I'd gotten as far as printing blank pages, and hadn't the will to go on past that point.   :Smile: 

Well done!

----------

## bdm

denials, thanks for that throurough tutorial, but I did what you said before CUPS was installed (this is a new installation). What can I do now to have minimal damage?

----------

## bdm

Just wanted to post back and report a success!

Thanks again.

----------

## kernelOfTruth

@denials:

just wanted to say: "thank you"

this worked fine with the MFC5840CN, in this way I'm not dependent on a rpm installation, yay!   :Very Happy: 

----------

## bdm

Actually, I'm still having problems. As soon as I installed it with your guide, ti worked fine until I rebooted. Now I can't even access the the CUPS  local site to check my printers status. And yes, CUPS is as put as boot.

Any ideas?

----------

## kernelOfTruth

```
rc-update -s
```

show what for cups ?

do a 

```
etc-update
```

and 

```
/etc/init.d/cupsd restart
```

then take a look again at 127.0.0.1:631

otherwise look if dependencies for cups changed:

```
revdep-rebuild -p
```

(before that removing old files:

```
rm /root/.revdep*
```

might be necessary)

----------

## reyneke

First of all: one huge thank you goes to Denials for this howto. You just made my day.

This Howto also works flawlessly for a Brother HL-2030. There's only one little problem: the drivers do not work with cups-1.2.x. Even the workaround proposed in the Brother FAQs didn't work (for me). Solution: install cups-1.1.28.

Cheers,

rey

----------

## kernelOfTruth

you tried those ?:

https://forums.gentoo.org/viewtopic-p-3832567.html#3832567

these are in fact Denials steps but modified / completed by myself to work with cups-1.2*

kudos & thanks to him   :Very Happy: 

----------

## reyneke

 *kernelOfTruth wrote:*   

> you tried those ?:
> 
> 

 

w00t! Now it works perfectly! Thank you for this hint.

----------

## bluesea

Great guide.  The only difference for me was that the brother script created 

```
/usr/lib/cups/filter/brlpdwrapperHL2040
```

which CUPS could not find.

See that foomatic-rip was another cupsFilter, I put a copy (ln -s) of brlpdwrapperHL2040 everywhere that there was a copy of foomatic-rip, all of which are links to the /usr/bin version:

```

cd /usr/lib/ppr/interfaces/

ln -s /usr/lib/cups/filter/brlpdwrapperHL2040 .

cd /usr/lib/ppr/lib/

ln -s /usr/lib/cups/filter/brlpdwrapperHL2040 .

cd /usr/libexec/cups/filter/

ln -s /usr/lib/cups/filter/brlpdwrapperHL2040 .

```

Success!

----------

## godsmack420

I had the same problem not finding the filter and copied  brlpdwrapperHL2040 to the directories listed above but now I get "Printer not connected; will retry in 30 seconds..." error in CUPS.  The printer is connected, any ideas of what to try?  I've restarted CUPS, rebooted, and made sure USB printing support was compiled in kernel.

----------

## Alakhai

We should upload this guide to gentoo wiki... It is great! it worked for me with MFC7440N

----------

