Setup Brother HL-4150CDN Printer with CUPS on a 64-bit Debian Machine

Today’s plan is to install the Common Unix Printing System on a Debian Wheezy machine and configure it to work with a Brother HL-4150CDN network printer. 

Install CUPS and Printer Drivers

We are using 64-bit Debian Wheezy. CUPS, the Common Unix Printing System, is a daemon that runs in the background, waiting for print jobs to be submitted. CUPS it’s highly network oriented.

Install CUPS. Not that if you don’t run as root, then you need to add sudo to both apt-get commands:

# apt-get update && apt-get install --no-install-recommends cups

Install pre-required transitional package to migrate ia32-libs to multiarch:

# apt-get install ia32-libs

Download LPR and cupswrapper drivers:

$ wget http://download.brother.com/welcome/dlf005940/hl4150cdnlpr-1.1.1-5.i386.deb
$ wget http://download.brother.com/welcome/dlf005942/hl4150cdncupswrapper-1.1.1-5.i386.deb

MD5 hashes:

$ md5sum hl4150cdnlpr-1.1.1-5.i386.deb hl4150cdncupswrapper-1.1.1-5.i386.deb
dd803993d4a29a432d63141201821b82  hl4150cdnlpr-1.1.1-5.i386.deb
81c3abd6b831f90301ed9117b28f291e  hl4150cdncupswrapper-1.1.1-5.i386.deb

Install LPR and cupswrapper drivers:

# dpkg -i --force-all hl4150cdnlpr-1.1.1-5.i386.deb
# dpkg -i --force-all hl4150cdncupswrapper-1.1.1-5.i386.deb

Printer Configuration

The CUPS IPP printing system is closely related to the HTTP used on a web. As our printer is connected to LAN (not via USB cable), we can open a web browser and navigate to http://localhost:631/printers/ to configure it.

Click on a printer name and pick “Modify Printer”. A username and password may be requested as we’re entering the admin panel. It’s our root user’s credentials.

We need to to choose “LPD/LPR Host or Printer” for other network device.

 

Modify the connections string so it would look like lpd://<printer_IP>)/binary_p1.

Add a description and location.

Use current driver.

Finish by clicking “Modify Printer” button. Try to print something. Printer’s status should change from “Idle” to “Processing”.

Edit CUPS Configuration

We can add a new printer or delete an existing one by modifying the /etc/cups/printers.conf file. It contains definitions of existing printers:

# cat /etc/cups/printers.conf 
# Printer configuration file for CUPS v1.5.3
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer HL4150CDN>
UUID urn:uuid:245d161f-c3c8-39ca-76ad-2b6aba9de0c1
Info HL4150CDN
Location Main Desk
MakeModel Brother HL-4150CDN series CUPS
DeviceURI lpd://10.10.1.8/binary_p1
State Idle
StateTime 1393610675
Type 8392780
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>

Another way, the simpler one perhaps, is to modify printers by using a web-based configuration utility.

2 thoughts on “Setup Brother HL-4150CDN Printer with CUPS on a 64-bit Debian Machine

  1. Hi Tomas

    I have a new RPi3 and a networked HL-4150cdn which I’ve been trying to use to print.

    I came across your blog as other raspberry pi printing guides all had the same problem, with my print queue stopped.

    I’ve tried reinstalling the os and the problem is the same. I can print from my macs to the printer.

    I tried your instructions and got an error on # apt-get update && apt-get install –no-install-recommends cups

    pi@RPi3:~/Downloads $ sudo apt-get update && apt-get install –no-install-recommends cups
    Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
    Get:2 http://archive.raspberrypi.org jessie InRelease [22.9 kB]
    Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,982 kB]
    Get:4 http://archive.raspberrypi.org jessie/main armhf Packages [144 kB]
    Get:5 http://archive.raspberrypi.org jessie/ui armhf Packages [57.6 kB]
    Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
    Ign http://archive.raspberrypi.org jessie/main Translation-en
    Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
    Ign http://archive.raspberrypi.org jessie/ui Translation-en
    Get:6 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.5 kB]
    Get:7 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.3 kB]
    Get:8 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]
    Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
    Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
    Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
    Ign http://mirrordirector.raspbian.org jessie/main Translation-en
    Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
    Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
    Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
    Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
    Fetched 9,330 kB in 12s (730 kB/s)
    Reading package lists… Done
    E: Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied)
    E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

    also

    apt-get install ia32-libs

    pi@RPi3:~/Downloads $ sudo apt-get install ia32-libs
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package ia32-libs

    Have you seen this problem before of is it something with my RPi3 – I’m not a link guru so most of this doesn’t mean much to me?

    Thanks if you can help.

    • Hi Pete, you need sudo for both apt-get commands if you don’t run them as root. You get permission denied because you try to install packages as a regular user.

      As for the second error, you’re on Debian Jessie, where the article was written for Debian Wheezy. The package ia32-libs doesn’t exist in Jessie.

Leave a Reply

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