Me and my Lexmark printer
I recently brought a new laser printer with double-side feature.
I was really happy, because friends just tell me “It work out-of-the-box with FreeBSD”.
I fact, it don’t. I had to make some hacks to make it working.
The Printer is a MB2236 (MB2200 series), double-sided and scanner.
It’s connected to my local network, with a fixed IPv4 address.
As excepted there is no FreeBSD drivers, only windows and Linux
.rpm based distribution and a curious file
Drivers files for CUPS-base systems. Let’s take it from this
I downloaded a
Uncompress the file
Using the old school
uncompress Unix utility, I obtain a
.tar file which
it’s easy to untar. The result is a folder named
As you can guess, there is a lot of
ppd files and a shell script
install_ppd.sh. This script won’t run on FreeBSD without modifications. I need
to change some path to be conform to the FreeBSD hierarchy.
In fact it was easy, just add
/local on most path. In order to change
/usr/local/share/footmatic. And so on.
Run the script.
Once modified, the script run well \o/. That’s a first victory.
Modify some path
/usr/local/libexec/cups/filter/rerouteprintoption is a perl script
Linux way shebang. Once again changing
/usr/local/bin/perl solve a big trouble.
The PPD file
The script make a big part, but not all.
/usr/local/share/ppd create a
Lexmark folder and copy, from
ppd_files/GlobalPPD_1.4/Lexmark_MB2200_Series.ppd into it.
cupsd we need to install the
linux-c7 emulation packages:
sudo pkg install linux-c7
And make something really bad on FreeBSD, make a change in the system filesystem
by creating a symlink into
sudo ln -s /usr/local/libexec/cups /usr/lib
cups launch at boot time
service cupsd start
Create the printer
With your browser go to
http://localhost:631 in order to create your printer.
Create and admin the printer is not the goal of this blog post. You can find help directly on the cups page.
This method does not use the system
lpr print-system. I really try to find how
to make it work but I can’t. All my files seems ok (
/etc/printcap), I can ping
the printer and send via
netcat a file on it, but the
lpr system does not
allow me to print.
The “old school "
There is another (brick in the wall) way to use this printer. The “good old
Enable and launch the daemon
The most easy part, enabling and start the daemon:
sudo sysrc lpd_enable="YES" sudo service ldp start
Declare the printer in the
Not all the option of this file could be explain on the post. Remember to read the man page for more option or more detailed explanation.
lp:\ :firstname.lastname@example.org:\ :sh=false:\ :mx#0:\ :sd=/var/spool/output/lpd:\ :if=/usr/local/libexec/psif:\ :lf=/var/log/lpd-errs:
The default printer is call
:lp=9100@ipaddres:is the ip address of my printer and the listen port;
:mx#0:max file size;
lf=/var/log/lpd-errs:error login file path and name
Be really careful of difference between
You can check the syntax of your file with
Create the spool dir
The spool directory (
sd line of
printcap file) must be exist.
sudo mkdir /var/spool/output/ldp
and must belong to
sudo chown -R daemon:daemon /var/spool/output/ldp
Then your can restart the
The filter script
The page said
exactly the same things as this post and give you the source of the
Paper size default
You surely need to install the ASCII to Postscript filter depending of your default paper size:
pkg search enscript enscript-a4-1.6.6_3 ASCII to PostScript filter enscript-letter-1.6.6_3 ASCII to PostScript filter enscript-letterdj-1.6.6_3 ASCII to PostScript filter nenscript-1.13.3 Clone of the proprietary enscript program from Adobe Systems p5-Tk-Enscript-1.10_4 Text-to-PostScript converter using Tk::Canvas zh-enscript-a4-1.6.6_3 ASCII to PostScript filter
Next? You should print from the command line:
Or from differents softwares, choosing
Print to LPR.
It take me a long long time to find a way to make this printer print… Hope this can be help you. I must admit that I prefer use the “old school way” :-)
Thanks to the FreeBSD-Questions mailing list members, who help me to find a solution.