You are on page 1of 4

Scan using CanoScan LiDE 120 in 32 bit Linux Mint 18 (Ubuntu 16):

Finally Solved.
There are no linux drivers published by Canon for this low cost, USB powered Scanner, which can
scan quite fast from 75 to 2400 dpi.

It is a quite a source of frustration for linux users. The sane website http://www.sane-
project.org/cgi-bin/driver.pl?manu=Canon&model=LiDE+120&bus=any&v=&p=

lists CanoScan LiDE 120 as:


GL124+ based, resolution from
CanoScan LiDE 120 USB 0x04a9/0x190e unsupported
75 to 2400 dpi
The backend version is gensys 1.0-63

However, we can reliably get the scanner to work perfectly in 32 bit Linux Mint 18 (Ubuntu 16) if
we Compile Sane From Source

Sane is the software that controls scanners under Linux. There are times that you need to build sane
from source, such as when bugs are fixed or a new scanner support is added. This is a relatively
advanced process for a new Linux user.

Steps:
Open a Terminal and type:

sudo apt-get install libusb-dev build-essential libsane-dev


sudo apt-get install libavahi-client-dev libavahi-glib-dev

Install git-core:

sudo apt-get install git-core

Download the source code

git clone git://git.debian.org/sane/sane-backends.git

cd sane-backends

Discover where your existing sane is installed

sudo find /usr/lib -name 'libsane-dll.so'

The full path of libsane-dll.so is returned. For example "/usr/lib/i386-linux-gnu/sane/libsane-dll.so"


Remove "/sane/libsane-dll.so" from the end and, when configuring, set libdir to the remainder of the
path
sudo find /usr/lib -name 'libsane-dll.so'

./configure --prefix=/usr --libdir=/usr/lib/i386-linux-gnu --sysconfdir=/etc --localstatedir=/var


--enable-avahi
make
sudo make install
[make takes a long time to compile all backends. If you only need the Canon backends you can
speed up compilation by specifying the Canon backends.

./configure --prefix=/usr --libdir=/usr/lib/i386-linux-gnu --sysconfdir=/etc --localstatedir=/var


--enable-avahi BACKENDS="Canon test"
make
sudo make install

will compile only the Canon and test backends.]

Plug in your CanoScan LiDE 120 scanner and type

sane-find-scanner

and your scanner should be listed. Now try

scanimage -L
sudo scanimage -L

If your scanner is detected with both of these commands, you have a successful install.
If it is detected with sudo but not as user, then you have a permissions problem. If it is not detected
with either, see Troubleshooting below

Permissions problem:

If you can scan as root (sudo), but not as user, you have a permissions issue. Ubuntu 16 releases use
udev to set permisions. Some previous releases used HAL. To edit udev, open /lib folder as root and
open the /lib/udev/rules.d/40-libsane.rules file with a text editor. Then add the following two lines
(change the scanner name and usb product id and vendor id to match your scanner):

# Canon CanoScan Lide 120


ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="190e", ENV{libsane_matched}="yes"

Save the file, exit gedit and Scan Away.

Use Simple Scan to scan to image or pdf files.

To install Simple Scan, type in terminal:


sudo apt-get install simple-scan

Troubleshooting:
If you follow the above instructions and cannot scan, there are several useful things you try.

First, check the file /etc/sane.d/<Canon.conf>, where backend is the name of the backend that your
scanner uses. Your scanner should be listed in this file, along with its usb id. If it is not listed, then
add it, following the format that the other scanners use. In this example we are checking a scanner
that uses the genesys backend.

cat /etc/sane.d/genesys.conf

A few of the older backends are deactivated by default. You can check for this by:
cat /etc/sane.d/dll.conf

Open /etc/sane.d/dll.conf as root (sudo) and make sure that your backend is not commented with a
'#'. If your backend is commented out, then delete the # with your favorite text editor.

Some additional commands that can be helpful are:

lsusb

Returns all usb devices

sane-find-scanner

Returns all attached scanners, supported or not

scanimage -L

Returns attached supported scanners

sudo scanimage -L

same as above, with root privileges.

scanimage -T

Runs a test of the scanner

scanimage -V

returns version of sane-backends

Updating sane-backends After Initial "git clone"

If you have previously cloned the source code and want to download the latest code, use the
following:

cd ~/sane-backends
git pull

Then proceed with compiling sane as described above.

Compiled Sane without Configure Flags

Another problem that occasionally comes up is that someone tries to build the latest version of sane
as described above, but they forget to add the recommended flags after the ./configure command.

--prefix=/usr --sysconfdir=/etc --localstatedir=/var

What happens is that Ubuntu ships with the sane libraries in /usr/lib/sane.

If you build sane from source with


./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var

the new sane libraries will be installed over the previous ones in /usr/lib/sane.

But if you build sane with just

./configure

the new sane libraries will be installed in /usr/local/lib/sane.

To make sure that the newest version of sane (in /usr/local/lib/sane) is used

gksu gedit /etc/ld.so.conf

To use the old version it should read

include /etc/ld.so.conf.d/*.conf
include /usr/lib

To use the new version, change it to

include /etc/ld.so.conf.d/*.conf
include /usr/local/lib

Then run

sudo ldconfig

and you should be running the latest sane.

You might also like