我有一台佳能 Pixma 打印机/扫描仪;第一次通过 USB 连接到我的 Ubuntu 22.04 笔记本电脑时,我不需要做任何特殊操作即可打印。
但是,当我尝试扫描时,xsane
显示“没有可用的设备”;并且:
$ scanimage -L
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
并且simple-scan
(文档扫描仪)写道:“需要其他软件”,“您需要为扫描仪安装驱动程序软件”,其中“安装驱动程序软件”注明:“您似乎有一台佳能扫描仪,它受Pixma SANE 后端。请检查您的扫描仪是否受 SANE 支持...”
但是,我确实有:
$ ls -la /usr/lib/x86_64-linux-gnu/sane/libsane-pixma.so.1.1.1
-rw-r--r-- 1 root root 256344 Mar 27 2022 /usr/lib/x86_64-linux-gnu/sane/libsane-pixma.so.1.1.1
这可能是什么问题?
答案1
运行时发现了这一点:
$ sane-find-scanner
# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.
# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.
...
could not fetch string descriptor: Pipe error
could not fetch string descriptor: Pipe error
could not open USB device 0x04a9/0x180b at 001:062: Access denied (insufficient permissions)
...
# No USB scanners found. If you expected something different, make sure that
# you have loaded a kernel driver for your USB host controller and have setup
# the USB system correctly. See man sane-usb for details.
...
# You may want to **run this program as root** to find all devices. Once you
# found the scanner devices, be sure to adjust access permissions as
# necessary.
啊,如果我需要以 root 身份运行,sudo
那么:
$ sudo sane-find-scanner
# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.
# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.
could not fetch string descriptor: Pipe error
could not fetch string descriptor: Pipe error
found possible USB scanner (vendor=0x04a9 [Canon], product=0x180b [MG3000 series]) at libusb:001:062
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
...
知道了:
$ sudo scanimage -L
Created directory: /var/lib/snmp/cert_indexes
device `pixma:04A9180B_62FF57' is a CANON Canon PIXMA MG3000 Series multi-function peripheral
...现在也sudo simple-scan
可以工作了,sudo xsane
尽管我确实收到了一条很大的警告,警告我不要xsane
运行sudo
...
所以我尝试通过
- 12.04 扫描仪作为超级用户工作正常,但无法被识别为普通用户
- https://unix.stackexchange.com/questions/184367/scanimage-does-not-find-scanner-unless-sudoed-but-shows-up-with-sane-find-scan
sudo nano /lib/udev/rules.d/60-libsane1.rules # file existed for me, so does /lib/udev/rules.d/99-libsane1.rules
添加
# Canon Pixma
ATTRS{idVendor}=="04a9", MODE="0666", GROUP="scanner", ENV{libsane_matched}="yes"
... 接近LABEL="libsane_rules_end"
,做了
sudo adduser myusername lp
sudo adduser myusername scanner
...并改变了
$ cat /etc/sane.d/canon.conf
#canon.conf
scsi CANON IX
usb 0x04a9 0x180b
和
sudo udevadm control --reload-rules && sudo udevadm trigger
...但如果没有 sudo 我仍然无法使用它。
哦,好吧——这就是我所缺少的:https://unix.stackexchange.com/questions/654731/scanner-available-only-with-sudo
下次您登录时,您的uid将能够使用扫描仪。
所以在经历了这一切之后,你必须 登出进而重新登录和只有这样无需scanimage -L
sudo
操电脑,操扫描仪,操佳能,操 Ubuntu,操 Windows,操 Mac OSX——这真是浪费时间,只是纯粹的熵和狗屎......我非常讨厌这种情况;因此这个操蛋的世界应该被毁灭——希望现在正在开发的所有那些狗屎人工智能都能尽快发射所有核弹,结束这种狗屎的存在