安装 Epson Linux 扫描仪驱动程序(适用于 v550)时出现语法错误

安装 Epson Linux 扫描仪驱动程序(适用于 v550)时出现语法错误

我有一台 Epson v550 扫描仪,并且已经下载了最新的官方驱动程序文件。

http://support.epson.net/linux/en/iscan.php?model=perfection-v550&version=2.30.4

当我提取文件并尝试安装iscan-data包时,出现以下错误:

sudo dpkg -i iscan-data_1.39.1-2_all.deb 
[sudo] password for brylie: 
(Reading database ... 342144 files and directories currently installed.)
Preparing to unpack iscan-data_1.39.1-2_all.deb ...
Unpacking iscan-data (1.39.1-2) over (1.39.1-2) ...
Setting up iscan-data (1.39.1-2) ...
expr: syntax error: missing argument after ‘-’
tail: invalid number of lines: ‘/lib/udev/rules.d/60-libsane.rules’

笔记:运行时我遇到同样的错误./install.sh,它只是与iscan-data包有关。

我该如何修复导致 .deb 安装中断的语法错误?

编辑:

$ dpkg -S /lib/udev/rules.d/60-libsane.rules
libsane:i386, libsane:amd64: /lib/udev/rules.d/60-libsane.rules
$ cat /lib/udev/rules.d/60-libsane.rules
# This file was automatically created based on description files (*.desc)
# by sane-desc 3.5 from sane-backends 1.0.27
#
# udev rules file for supported USB and SCSI devices
#
# For the list of supported USB devices see /usr/lib/udev/hwdb.d/20-sane.hwdb
#
# The SCSI device support is very basic and includes only
# scanners that mark themselves as type "scanner" or
# SCSI-scanners from HP and other vendors that are entitled "processor"
# but are treated accordingly.
#
# If your SCSI scanner isn't listed below, you can add it to a new rules
# file under /etc/udev/rules.d/.
#
# If your scanner is supported by some external backend (brother, epkowa,
# hpaio, etc) please ask the author of the backend to provide proper
# device detection support for your OS
#
# If the scanner is supported by sane-backends, please mail the entry to
# the sane-devel mailing list ([email protected]).
#
ACTION!="add", GOTO="libsane_rules_end"

# The following rule will disable USB autosuspend for the device
ENV{DEVTYPE}=="usb_device", ENV{libsane_matched}=="yes", TEST=="power/control", ATTR{power/control}="on"

SUBSYSTEMS=="scsi", GOTO="libsane_scsi_rules_begin"
GOTO="libsane_rules_end"

LABEL="libsane_scsi_rules_begin"
KERNEL!="sg[0-9]*", GOTO="libsane_rules_end"

# Generic: SCSI device type 6 indicates a scanner
ATTRS{type}=="6", ENV{libsane_matched}="yes"

# Some scanners advertise themselves as SCSI device type 3

# Wildcard: for some Epson SCSI scanners
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="SCANNER*", ENV{libsane_matched}="yes"

# Epson Expression 800 | Epson Expression 800
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="Expression800", ENV{libsane_matched}="yes"

# Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="GT-9700", ENV{libsane_matched}="yes"

# Epson Perfection 3200 | Epson GT-9800F | Epson Perfection 3200 PHOTO
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="GT-9800", ENV{libsane_matched}="yes"

# Epson GT-X900 | Epson Perfection V700 Photo | Epson Perfection V750 Photo
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="GT-X900", ENV{libsane_matched}="yes"

# Epson Perfection 636S | Epson Perfection 1200S | Epson Perfection 1200S
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="Perfection1200", ENV{libsane_matched}="yes"

# Epson Perfection 636 | Epson Perfection 636S
ATTRS{type}=="3", ATTRS{vendor}=="EPSON", ATTRS{model}=="Perfection636", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet 4p
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C1130A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet IIc
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C1750A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet IIp
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C1790A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet IIcx
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C2500A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet 4c
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C2520A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet 5p
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C5110A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet 6200C
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C6270A", ENV{libsane_matched}="yes"

# Hewlett-Packard ScanJet 6300C
ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C7670A", ENV{libsane_matched}="yes"


LABEL="libsane_rules_end"

答案1

我正在使用 Debian 10 (Buster),也发现了同样的问题。该错误的根源在于软件包/usr/lib/iscan-data/make-policy-file中包含的文件。它尝试在文件中iscan-data_1.39.1-2_all.deb查找字符串。但该文件的内容在 Debian 9 和 10 之间发生了很大变化,因此它找不到这样的字符串,因此失败了。我猜 Ubuntu 中也可能出现这种情况。尽管出现了该错误,但 SANE 后端似乎安装得很好。{idProduct}/usr/lib/udev/rules.d/60-libsane.rules

除了这个问题之外,我还发现了另一个问题,也与文件有关60-libsane.rules:它不再包含授予scanner组访问扫描仪总线的规则。所以我只能root从命令行使用用户进行扫描。检查一下错误报告了解更多信息。添加udev类似于该报告中提到的规则,现在我可以使用我的用户和 GUI 再次扫描。我的规则如下:

ENV{ID_VENDOR_ID}=="04b8", ENV{ID_MODEL_ID}=="0130", RUN+="/usr/bin/bash -c '/usr/bin/setfacl -m g:scanner:rw $env{DEVNAME}'"

我需要按供应商 ID 和型号 ID 进行过滤(我的情况是 EPSON Perfection V500 Photo),因为该libsane_matched属性似乎为空。我猜是因为第一段中提到的安装程序存在问题,所以没有正确设置。

相关内容