[1+1=2]

OneAndOneIs2

« Major upgradeVersion go up, version go down »

Sat, Jan 23, 2010

[Icon][Icon]Printing in Ubuntu

• Post categories: Omni, FOSS, Technology, My Life, Helpful

So following a hideous Windows screwup, I was asked to install Linux on Tina's mother's laptop. Didn't need to do much - basic internet and document handling. No problem.

So I burned the latest Ubuntu and installed it. Had the typical mild frustration of installing the Wifi card (I know the hardware manufacturers are trying to save a few pennies by having the driver load the firmware onto the card, but seriously? Is flash memory really THAT expensive these days? Fscking cheapskates) and that was pretty much it done. I enabled Compiz just for a laugh and was surprised that the clapped-out old machine was capable of running it flawlessly; desktop-cube, wobbly-windows and all.

I handed it over last weekend and all was well until she came to try printing something. Which didn't work.

It was a Dell 720 printer. So the first thing I did was work out what Dell had rebadged, which was a Lexmark Z600. Which Ubuntu has no driver for. So it had to be installed manually.

Lexmark, to be fair, does actually supply a Linux driver. Good on them. But it's RPM only. And there were all kinds of hiccups along the way, so I thought I'd just make a note of everything I had to do to get a Dell 720 to work on the latest version of Ubuntu:

Go to Lexmark's website & download the RPM & extract the file:
tar -zxvf CJLZ600LE-CUPS-1.0-1.TAR.gz

Because the sh script is broken, get the binary manually:
tail -n +143 z600cups-1.0-1.gz.sh > install.tar.gz

Extract the install file:
tar -xvzf install.tar.gz

Convert the files from RPM to DEB:
alien z600cups-1.0-1.i386.rpm
alien z600llpddk-2.0-1.i386.rpm

Install the DEB files:
sudo dpkg -i z600cups-1.0-1.i386.deb
sudo dpkg -i z600llpddk-2.0-1.i386.deb

Update the printer backend
sudo ldconfig

Unzip the PPD
cd /usr/share/cups/model
sudo gunzip Lexmark-Z600-lxz600cj-cups.ppd.gz

Restart CUPS
sudo /etc/rc2.d/S50cups restart

Check that the printer backend is broken
cd /usr/lib/cups/backend
./z600

Mount the USB filesystem
To /etc/fstab, add:
usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0
sudo mount usbfs

Check that the printer backend is STILL broken
cd /usr/lib/cups/backend
./z600

When you get an error because the current Ubuntu doesn't have libstdc++5 available
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_i386.deb
sudo dpkg -i libstdc++5_3.3.6-17ubuntu1_i386.deb

Check that the printer backend is no longer broken
cd /usr/lib/cups/backend
./z600

And at this point, you should be able to plug in the printer and select the Lexmark Z600 driver from the list of options. And then it'll work flawlessly.

Yay!

And they say it's not easy to install printers under Linux...

9 comments

jzacsh
Comment from: jzacsh [Visitor] · http://jzaksh.com/
Hi, you make this sound fun (some how), impressive. I don't have any printer issues now, but figured I'd learn something from your post.

The part I don't understand, I'm really interested in (if you don't mind indulging me):

tail -n +143 z600cups-1.0-1.gz.sh > install.tar.gz

I totally don't understand what you're doing when you output the *.gz.sh file -- I mean, I understand technically, you're cutting out a certain amount of the file (the 143rd line, and on) -- but I don't understand logically. I would've thought that the file is just a plain ASCII text -- how did it suddenly become an un-archiv-able file (*just* because you named it as such)??

:\ Do you mind pointing me to something I can google about this?

On a separate note, the alien utility is really cool, definitely something I'll remember.
25/01/10 @ 06:27
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
The gz.sh file contains a binary file as well as some text. The tail command just crops out the text and puts the binary chunk into a tar.gz file.
25/01/10 @ 11:13
Agent Red
Comment from: Agent Red [Visitor] · http://support.lexmark.com
Nice work!

FWIW, Newer Lexmark printers DO have real Linux drivers in deb and rpm.

http://bit.ly/5Z28fz
25/01/10 @ 19:16
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
So I see.. although source code would probably be more useful all-round as then the distro maintainers could make your drivers available globally. Users out there on distros like Gentoo, Arch, and Slackware are still going to struggle with RPMs and DEBs
26/01/10 @ 15:33
Dad
Comment from: Dad [Visitor]
How do you KNOW all this stuff????
30/01/10 @ 09:17
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
Cuz I'm damn clever :o)

And more importantly, I know how to use Google..
30/01/10 @ 10:56
MadMonkey
Comment from: MadMonkey [Visitor]
I love the "And they say it's not easy to install printers under Linux..."

I've been trying to get the Lexmark X7675 printer driver working and I was about to give up - till I saw your post.

How would I select the "magic" number - since 143 doesn't seem to work for the "lexmark-08z-series-driver-1.0-1.i386".

I end up with:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors

I tried using the "Bless" hex-editor and hacking the bad script away still - no love. Same issue (not in gzip format).

Any help would be appreciated. Thanks.
28/02/10 @ 02:22
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
The "magic" number is easy: What you basically have in the example I gave is a shell script with a binary file in it.

All you need to do is get rid of the lines at the top with shell script commands, and you have the binary.

Opening the file in a text editor shows that it has 142 lines of readable text before breaking down into illegibility:

136 fi
137 [ "$keep" = y ] || { cd /tmp; /bin/rm -rf $tmpdir; }
138 else
139 echo "Cannot decompress $0"; eval $finish; exit 1
140 fi
141 eval $finish; exit $res
142 END_OF_STUB
143 ‹
28/02/10 @ 16:45
CED
Comment from: CED [Visitor]
Good day,

I have followed your instructions; however keep getting an error with regards to the usbfs in /etc/fstab. I copied it word for for and it says no process.

Suggestions?
26/05/10 @ 11:33

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
 

[Links][icon] My links

[Icon][Icon] http://t.co/9VG31Knw
01/02/12

[Icon][Icon] Facebook Syndication Error
03/02/12

[Icon][Icon] I last listened to:
Johann Pachelbel - Canon in D major

[Icon][Icon] Most recent photo:
Submersible houseboat

[Icon][Icon]About Me

[Icon][Icon]About this blog

[Icon][Icon]My LQ profile

[Icon][Icon]My /. profile

[Icon][Icon]My Wishlist

[Icon]MyCommerce

[FSF Associate Member]


February 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        

Search

User tools

XML Feeds

eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

free open source blog