Guide: Installing Printer Driver (Brother HL-2350DW)

I have a Brother HL-2350DW printer but it’s not a supported model. Here is a guide on how to install this printer and this could be helpful for other models as well.

Motivation

To add a printer, usually you can go to Devices->Printers tab in gnome-settings. Click Unlock and after authentication, click Add.... It will try to find the printer and you can also specify its IP address as well. Click the printer and in the next pop-up window you can see a list of manufacturers and supported models.

My Brother 2350DW is not supported, so I have to install the driver first, and then you can select the correct driver to add the printer.

Unfortunately, drivers are usually proprietary and thus Clear Linux cannot ship them, so in the next section will cover the way how I installed the driver and added the printer.

Installation

Method 1, manual install according to official guide

Brother has its Linux driver in rpm and deb packages, and I downloaded the rpm driver package.

After downloading both of them, I took a look of the rpm package, which looks like this

├── etc
│   └── opt
│       └── brother
│           └── Printers
│               └── HLL2350DW
│                   └── inf
├── opt
│   └── brother
│       └── Printers
│           └── HLL2350DW
│               ├── cupswrapper
│               │   ├── brother-HLL2350DW-cups-en.ppd
│               │   ├── Copying
│               │   ├── lpdwrapper
│               │   └── paperconfigml2
│               ├── inf
│               │   ├── brHLL2350DWfunc
│               │   ├── brHLL2350DWrc
│               │   └── setupPrintcap
│               ├── LICENSE_ENG.txt
│               ├── LICENSE_JPN.txt
│               └── lpd
│                   ├── armv7l
│                   │   ├── brprintconflsr3
│                   │   └── rawtobr3
│                   ├── i686
│                   │   ├── brprintconflsr3
│                   │   └── rawtobr3
│                   ├── lpdfilter
│                   └── x86_64
│                       ├── brprintconflsr3
│                       └── rawtobr3
└── var
    └── spool
        └── lpd
            └── HLL2350DW

This is optional but I prefer to know what are about to be installed.

I also checked the install scripts of the rpm package by

rpm -qp --scripts hll2350dwpdrv-4.0.0-1.i386.rpm 

, where rpm can be installed by swupd bundle-add dnf.

Following the official guide, I installed the driver by executing

rpm  -ihv  --nodeps  hll2350dwpdrv-4.0.0-1.i386.rpm

And then I can add the driver via the web interface of CUPS at http://localhost:631/printers/, which requires me to correctly specify certain parameters such as Device URI and Manufacturer.

More details are available on the official website.

Method 2, via official Driver Install Tool

Brother also has a utility Driver Install Tool, which contains shell scripts to install the driver and (optionally) add the printer.

I downloaded this utility and find that its just bash scripts to install and uninstall the driver. Although the script is considerably long, I read it and found that it’s not likely to break the system.

Execute the script with root privilege, when it ask me what’s the model of my printer, I entered hll2350dw because the script matches the product name with a rpm package in the same directory.

Then it allows me to specify Device URI for adding the printer, and after I gave it the IP address, the driver is added.

Takeaway

For a more general case where there’s no such driver install tool available, the following lines of codes might help, which comes from the Driver Install Tool of Bose.

Under the hood, what it does is the following:

  1. Install the driver by
    rpm -ihv --nodeps --replacefiles --replacepkgs hll2350dwpdrv-4.0.0-1.i386.rpm
    
  2. The post-install script of the rpm mainly did two things:
    1. Creates symlinks
    2. Install a ppd file by
      lpadmin -p HLL2350DW -E -v usb://dev/usb/lp0 -P /usr/share/ppd/brother/brother-HLL2350DW-cups-en.ppd
      
      , which should be able to add the printer if it’s connected via USB.
  3. After I specified the URI, it does
    lpadmin -p HLL2350DW -v socket://192.168.1.130 -E
    

So, try these

  1. Install the driver with
    rpm -ihv --nodeps --replacefiles --replacepkgs DRIVER.rpm
    
  2. If the printer is connected via USB,
    lpadmin -p MODEL -E -v usb://dev/usb/lp0 -P PPD_FILE
    
    PPD_FILE is the path to PostScript Printer Description files, which in my case is /usr/share/ppd/MANUFACTURER/MODLE.ppd. This can be opened by text editor and in which the ModelName tells you what you should use to replace MODEL in lpadmin command.
  3. If the printer is in other location and you know its Lan IP address,
    lpadmin -p MODEL -v socket://IP_ADDRESS -E
    
  4. To make it better, you can modify the install scripts of rpm so it operates on /usr/local/ instead of /usr.

–replacefiles
Install the packages even if they replace files from other,
already installed, packages.

–replacepkgs
Install the packages even if some of them are already installed
on this system.

It’s dangerous, avoid it; if there’s no another way - make a backup of all replaced files.

It seems to me that it’s unlikely drivers from different vendors will install the same file.