[原创]在Manjaro Linux上安装brother-t420w打印机
个人原创,如有转载,请注明出处。——by realasking
最近到了一个大学工作,为了方便,自己买了一个Brother DCP-T420W打印机。这个打印机是墨仓式彩色打印和扫描复印一体机,并且支持无线打印功能.根据它的说明,在Windows 11、Realme GT Neo和Ubuntu 20.04上安装使用都非常方便。但是,我还有两台机器使用的是Manjaro Linux,官方没有提供相应的解决方案。这两天是五一假期,就试着折腾了一下,解决了这个问题。以下就是处理办法。
1.打印机设置
a. 在浏览器中输入打印机地址:192.168.0.105,然后输入管理密码完成登录。
192.168.0.105是我的打印机的地址,如果网友不知道自己打印机的地址的话,登录到你的路由器或Wifi的管理页面,查看连接设备即可。
b. 点击网络-服务,记录下服务名称
c. 点击网络-协议,点击LPD后的高级设置,勾选启用LPD标志,然后提交
2.驱动准备
a.从AUR上下载brother-dcpt520w的PKGBUILD和相关附加文件,并将brother-dcpt520w文件夹改名为brother-dcpt420w
b.将以下文件替换brother-dcpt420w中的文件:
PKGBUILD
文件:
bash # Maintainer: none <none@none.none> # Modified by realasking from brother-dcpt520w maintained by Chiwan Park pkgname=brother-dcpt420w pkgver=3.5.0 pkgrel=1 pkgdesc="Driver for the Brother DCP-T420W wifi multifuncional printer" url="http://solutions.brother.com/linux/en_us/index.html" license=('custom:brother') install="brother-dcpt420w.install" arch=('i686' 'x86_64') optdepends=('sane: scanning support' 'brscan4: making dcpt420w available to sane' 'brscan-skey: scankey support if connected via usb') if [[ "$CARCH" == "x86_64" ]] ; then depends=('a2ps' 'cups' 'lib32-glibc') elif [[ "$CARCH" == "i686" ]] ; then depends=('a2ps' 'cups') fi source=( "https://download.brother.com/welcome/dlf105168/dcpt420wpdrv-3.5.0-1.i386.deb" \ "fix_lp.patch" ) sha256sums=( '3ede819a65aec379ec7676f7ac0cacabd70879fbaaf2c7978eeae406c0e1c1f2' \ 'ddb53ba14356b1fb98f19e3b32f124e878f06819a2cb6cb40a719d2250fababf' ) build() { cd "$srcdir" tar -xf data.tar.gz -C . tar -xf control.tar.gz -C . patch -Np0 < fix_lp.patch } post_install() { /opt/brother/Printers/dcpt420w/cupswrapper/cupswrapperdcpt420w } package() { install -d $pkgdir/usr/bin install -d $pkgdir/var/spool/lpd cp -R $srcdir/opt $pkgdir/opt }
brother-dcpt420w.install
文件:
bash post_install() { # lpr /opt/brother/Printers/dcpt420w/inf/setupPrintcapij dcpt420w -i # cupswrapper /opt/brother/Printers/dcpt420w/cupswrapper/cupswrapperdcpt420w systemctl restart org.cups.cups.service } post_upgrade() { /bin/true } pre_remove() { # lpr /opt/brother/Printers/dcpt420w/inf/setupPrintcapij dcpt420w -e # cupswrapper /opt/brother/Printers/dcpt420w/cupswrapper/cupswrapperdcpt420w -e } op=$1 shift $op "$@"
fix_lp.patch
文件:
bash --- opt/brother/Printers/dcpt420w/inf/setupPrintcapij.old 2008-09-15 22:01:07.000000000 +0200 +++ opt/brother/Printers/dcpt420w/inf/setupPrintcapij 2008-09-15 22:01:26.000000000 +0200 @@ -34,7 +34,7 @@ if [ ! -d $SPOOLER_NAME ]; then mkdir $SPOOLER_NAME fi - chown lp $SPOOLER_NAME + chown root $SPOOLER_NAME chgrp lp $SPOOLER_NAME chmod 700 $SPOOLER_NAME
c.打包和安装
bash
makepkg sudo pacman -U brother-dcpt420w-3.5.0-1-x86_64.pkg.tar.zst
2023年8月23日注 ------------------------------------------------------------------------
现在安装brother-dcpt420w
后,org.cups.cups
服务已经不再存在,
需要手动启动cups
服务,但不必启动cups-browsed
服务:
bash sudo systemctl enable --now cups
------------------------------------------------------------------------
d.安装其它相关文件
bash
yay -S brother-cups-wrapper-common brother-lpr-drivers-common system-config-printer xsane xsane-gimp sane colord-sane
2023年8月23日注 ------------------------------------------------------------------------
在Arch
上还要做如下设置:
- 安装:
bash
yay -S nss-mdns mdns-scan qmdnsengine python-zeroconf
- 配置
用vi
打开/etc/nsswitch.conf
将如下行:
bash hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
替换为:
bash hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns
然后保存
- 重启电脑
------------------------------------------------------------------------
3.扫描功能设置
bash
sudo brsaneconfig4 -a name=Brother model=DCP-T420W ip=192.168.0.105
4.打印功能设置
a. sudo system-config-printer
b. 在Brother-DCP-T420W
图标上单击右键,点击属性
c. 点击设备URI
后的按钮
d. 点击网络打印机
-查找打印机
e. 点击以Brother-DCP-T420W
开头、以1-b中记录下来的服务名称加.local结尾的打印机,在连接中选择通过DNS-SD的IPP网络打印机
,然后点击应用
f. 点击生产和型号
后的按钮,选择从数据库中选择打印机
,点击Brother
,然后点击转发
,点击DCP-T420W(推荐)
,点击转发
g. 打印测试页和确定。
然后打印机就可以正常使用了。
2024年1月6日注 ------------------------------------------------------------------------
要让mdns生效,需要让avahi-daemon服务启动,最近发现新装的archlinux连这个服务都是默认关闭的。无语。