LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs > flshope
User Name
Password

Notices


Rate this Entry

Brother HL-2140 B&W Laser Printer under Debian 9 only prints blank pages: a fix

Posted 07-04-2017 at 05:28 PM by flshope

I recently installed Debian 9.0 on my primary machine (Pogo2011). This installation is dual boot with Ubuntu 16.04 and each OS booting from a separate hard disk, each with its own Grub installation. The machine had Debian 8.8 previously. I decided to do the Debian 9 installation as a clean install (rather than as an upgrade) because the 8.8 was a bit messed up (let me not go into that here). The Debian 9 install was done from a netinst CD. It appeared to be a textbook-successful install. The post-install configuring went without incident until I tried to install my printer, a Brother HL-2140 B&W Laser Printer.

As soon as I turned on the printer under Debian 9, the printer auto-installed without my having to do anything. However, any print job just resulted in printing endless blank pages. The same thing had happened under Debian 8, but the Settings/Printer application offered a menu of printers and drivers, and I had found a driver other than what the system chose that worked. Under Debian 9, the Settings/Printers application did not offer any such menus or choices. The following steps are what I used to get this printer working.

While working with Debian 8, I had figured out that a driver included in foomatic worked with the HL-2140. However, foomatic wasn't installed with my Debian 9. So I installed it with Synaptic. [N.b.: You want the item labeled "foomatic-db OpenPrinting printer support - database" (but not the one labeled "foomatic-db-compressed-ppds OpenPrinting printer support - Compressed PPDs derived from the database")].

To be sure the HL-2140 was still in the foomatic database, I ran the terminal command:

Code:
foomatic-ppdfile -A|less
which generated a list of every printer in the database, including

Code:
...
Brother HL-2140 Id='Brother-HL-2140' Driver='hpijs-pcl5e' CompatibleDrivers='Postscript hl1250 ljet4 lj5gray pxlmono hpijs-pcl5e lj4dith '
...
This is the same driver that Debian 8 provided. Printer drivers have an extension of .ppd, and the drivers for the installed printers are stored at

Code:
/etc/cups/ppd/
with root ownership only. The Debian 9 default driver file name for the HL-2140 is HL-2140-series.ppd. The foomatic driver files are not stored in the foomatic database as .ppd files. Rather, you must run a command (foomatic-ppdfile) to generate the .ppd file. Since I had never gone though this before, I decided to generate the driver file in my home directory (~/Documents) rather than /etc/cups/ppd/. The specific command I ran was

Code:
foomatic-ppdfile -p Brother-HL-2140 > HL-2140-series.ppd
I used the same file name (HL-2140-series.ppd) as the Settings/Printers installer file name, intending to overwrite it with the foomatic driver file and hoping the OS would not object to the change. After generating the new driver, I noted the file length was different from that of the default driver (indicating that I did indeed generate a different driver file). Working in my ~/documents directory, I changed ownership of the new driver file with the command

Code:
su root
chown root:root HL-2140-series.ppd
I then copied the new driver file as follows:

Code:
su root
cp HL-2140-series.ppd /etc/cups/ppd/.
Next, I started the Settings/Printers installer and printed a test page. This time the page printed correctly (not endless blank pages). I also printed a document from Libre Office Writer, which printed correctly. Then, I rebooted Debian and tested the printer again to be sure the reboot didn't reset the driver.
Posted in Uncategorized
Views 1345 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    Addendum: 06/19/18

    After recently installing Debian 9 with Xfce on my 2003 32-bit machine (I call it Pogo2003 -- see description below), I used the above procedure to get my Brother HL-2140 black and white laser printer working. The same identical procedure worked here as with Debian 9 on my 2011 machine. Just FYI.

    Machine:
    Pogo Linux Altura (purchased 2003)
    CPU: AMD Athlon(TM) XP 2400+ 2GHz (32 bit)
    RAM: 1GiB
    Current OS: Debian 9.4
    Desktop Environment: Xfce4
    Disks: 2 120 GB Maxtor IDE
    My hostname: pogo2003
    Printer: Brother HL-2140
    Posted 06-19-2018 at 07:05 PM by flshope flshope is offline
 

  



All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration