When I try to install iscan-perfection-v370-bundle-2.30.4.x64.deb on Debian 10 (Buster), I can see the following messages:

expr: syntax error: missing argument after „-“
tail: invalid number of lines: „/lib/udev/rules.d/60-libsane.rules“

Note: The second message appears in a locale based translation; it has been translated back to English by me.

Executing /sbin/dpkg-reconfigure iscan-data leads to the exact same messages.

As a result, the scanner is only available for the superuser; the superuser can execute iscan flawlessly.

Output of dpkg --status iscan-data:

Package: iscan-data
Status: install ok installed

What is the problem? How can it be fixed?

1 Answer 1


/sbin/dpkg-reconfigure iscan-data executes /usr/lib/iscan-data/make-policy-file which, in the provided version 1.39.1, contains the following code:

get_footer () {
    case "$MODE" in
            line_count=`cat $1 | wc -l`
            last=`sed -n '/{idProduct}/ =' $1 | tail -n 1`
            num_lines=`expr $line_count \- $last`
            tail -n $num_lines $1
            mesg "internal error: inconsistent $MODE handling" >&2
            exit 3

It determines that /lib/udev/rules.d/60-libsane.rules has 86 lines ($line-count) but fails to identify the last line containing {idProduct}. The reason is that /lib/udev/rules.d/60-libsane.rules does not contain any such line in Debian 10.

Unfortunately, get_header () and apparently also get_stanza () don't work with Debian 10, either. Hence, the resulting /lib/udev/rules.d/60-iscan.rules is useless.

Without a proper udev configuration, ordinary users will not be able to access the scanner.

My solution was to manually create /lib/udev/rules.d/60-iscan-manual.rules which will survive an update of the iscan-data package, at the risk of yielding a false match should the iscan bundle be uninstalled (or its update drops support for my scanner). It contains a single matching entry for my particular scanner model. I took the values for idVendor and idProduct from lsusb's output, so adapt those values for your particular model:

Bus 001 Device 026: ID 04b8:014a Seiko Epson Corp.

Here's my 60-iscan-manual.rules:

# rules apply to "add" action only
# ================================
ACTION!="add", GOTO="iscan_man_rules_end"

# distribute to respective rules
# ==============================
ENV{DEVTYPE}=="usb_device", GOTO="iscan_man_usb_rules"
SUBSYSTEM=="usb_device", GOTO="iscan_man_usb_rules"

# USB rules
# =========

# rules for supported USB scanners
ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="014a", ENV{libsane_matched}="yes"
# disable USB autosuspend, if the device was matched
ENV{libsane_matched}=="yes", TEST=="power/control", ATTR{power/control}="on"


# ===
  • 1
    Thank you. Works perfectly for me.
    – Sileria
    Dec 9, 2020 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .