If you happened to read my last article, Documentation – What’s The Secret Sauce of Enough But Not Too Much?, you may have caught that the products I work with run on an open source stack. Open source is the one constant characterizing most of my career. My first introduction to professional development was at a government contractor that ran Solaris on old sparcs. I also dabbled briefly with Microsoft writing Excel customizations through Visual Basic for Applications. From this point forward I’ve done nothing but write and manage applications that run on some distribution of Linux.
I absolutely love open source and can’t imagine working in any other environment. However, I am not a blind evangelist claiming open source is the ultimate solution. Like any technology, open source comes with its own set of challenges. This is particularly true when considering interoperability with Microsoft products. The company I work for is predominantly a Microsoft shop where Redmond’s offerings power both the desktop as well as a significant amount of application development. This can – and often does – mean limited support for anyone using open source.
For example, a shiny new Canon imageRUNNER ADVANCE C5030 recently arrived in the office. I walked over to our IT support guy as he was busily configuring the printer on company workstations.
“Hey Mike. Do you have a Linux driver on that disk?”
I knew the answer before I asked. I always ask. Partly to be a smart aleck; partly to remind IT we Linux guys exist. The answer is the usual smirk followed quickly by, “Yeah, right”. Looks like it is time to roll up the sleeves and get busy. My current distribution of choice is Ubuntu:
[email protected]:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.10 Release: 11.10 Codename: oneiric
I started with the built-in admin GUI by clicking the Printer Configuration menu item found on the System Settings application. From here, one can add a new printer by clicking New Printer. After a few seconds Ubuntu located and correctly identified the printer on the network. The default values listed in the setup menu felt correct and within seconds I had painlessly installed a printer called Canon IR-ADV C5030/5035 PXL. Unfortunately, an attempt to print a test page failed. No Easy Button here.
The first step is to check the log files, here:
Neither the log files nor the printer display helped much. Surprisingly, the access_log showed the printer config attempt and request to print a test page as successful:
localhost - - [10/Sep/2012:11:37:55 -0400] "POST / HTTP/1.1" 401 75 CUPS-Get-Devices successful-ok localhost - root [10/Sep/2012:11:37:55 -0400] "POST / HTTP/1.1" 200 4275 CUPS-Get-Devices - localhost - - [10/Sep/2012:11:38:06 -0400] "POST / HTTP/1.1" 200 5356292 CUPS-Get-PPDs - localhost - - [10/Sep/2012:11:39:47 -0400] "POST / HTTP/1.1" 200 5356292 CUPS-Get-PPDs - localhost - - [10/Sep/2012:11:41:06 -0400] "POST / HTTP/1.1" 200 91586 CUPS-Get-PPD - localhost - - [10/Sep/2012:11:41:11 -0400] "POST /admin/ HTTP/1.1" 401 91633 CUPS-Add-Modify-Printer successful-ok localhost - rich [10/Sep/2012:11:41:11 -0400] "POST /admin/ HTTP/1.1" 200 91633 CUPS-Add-Modify-Printer successful-ok localhost - rich [10/Sep/2012:11:41:12 -0400] "POST /admin/ HTTP/1.1" 200 120 Resume-Printer successful-ok localhost - rich [10/Sep/2012:11:41:12 -0400] "POST /admin/ HTTP/1.1" 200 120 CUPS-Accept-Jobs successful-ok localhost - rich [10/Sep/2012:11:41:12 -0400] "POST /admin/ HTTP/1.1" 200 149 CUPS-Add-Modify-Printer successful-ok localhost - rich [10/Sep/2012:11:41:12 -0400] "POST /admin/ HTTP/1.1" 200 138 CUPS-Add-Modify-Printer successful-ok localhost - rich [10/Sep/2012:11:43:11 -0400] "POST /printers/Test HTTP/1.1" 200 205756 Print-Job successful-ok
The error log listed something vague about a missing product:
W [10/Sep/2012:11:38:06 -0400] [CGI] Missing Product in /usr/share/cups/model/CNCUPSIRADV4051ZK.ppd! W [10/Sep/2012:11:39:47 -0400] [CGI] Missing Product in /usr/share/cups/model/CNCUPSIRADV4051ZK.ppd!
The printer setup wizard has several Canon variants to choose from. I tried them all. Two of them generated nondescript errors on the printer display itself.
This is where my knowledge of the Linux subsystem ends which means it is time to hit the web. The Canon USA web site has nothing helpful, but several minutes spent with my friend Google finds a driver at the Asian Canon support site. http://support-my.canon-asia.com/contents/MY/EN/0100270810.html. The driver is dated 13-Jul-2012, so I’m hopeful…
Elation quickly turns to despair when I realize Canon built the 64 bit driver in rpm format only. The only Ubuntu drivers I see are 32 bit. Wonderful. Luckily, RPM libraries can be converted to Debian format with a nifty utility called alien. Install it:
[email protected]:~$ sudo apt-get install alien
Now convert and install the drivers. The -i will automatically install each generated package, and remove the package file after it has been installed.
sudo alien -i cndrvcups-ufr2-uk-2.50-1.x86_64.rpm sudo alien -i cndrvcups-common-2.50-1.x86_64.rpm
I now have an option in Printer Configuration to create a UFR_II printer. Unfortunately, the test page still fails to print with little reason as to why in the log files. Continued spelunking through the web suggests that the lib64 directory needs to be symlinked:
sudo ln -s /usr/local/lib /usr/local/lib64 sudo ln -s /usr/lib /usr/lib64
Another attempt to print a test page fails. Further research suggests Ubuntu’s Access Control system AppArmor is denying CUPS (Common Unix Printing System) access to the drivers. You can override via a configuration entry in r.sbin.cupsd:
Then add the following exactly as shown, including the trailing commas :
/usr/lib64/cups/backend/cnusb Uxr, /usr/lib64/cups/filter/pstoufr2cpca Uxr,
Finally, restart the cups service to load the changes :
sudo service cups restart
Adding the AppArmor exception is what finally did the trick. At this point you should be able to add the Canon printer through the Printer Configuration page using a new printer type called iR-ADV_C5030_5035_(UFR_II). Finally!
Note that during my research I found a blurb suggesting that the printer drivers need a few 32 bit libraries in order to function correctly. I installed those libs months earlier to solve an unrelated problem and did not verify that they are truly needed for the printer install. They can easily be installed with:
sudo apt-get install ia32-libs sudo apt-get install libjpeg62:i386