Fedora 28 打印机配置 ( HP pro 1136M ,基于Windows 打印服务器使用 smb 协议)

时间:2022-02-21 05:24:13

Fedora 28 本身是没有打印服务的。我们需要安装下列软件:

安装好后,启动cups 系统、samba 系统、配置好防火墙,然后打开 system-config-printer 软件就能进行添加打印机了。

安装:

安装系统配置GUI :

~ sudo yum install system-config-printer.x86_64
~ sudo yum install cups (本身 fedora 已经安装了 cups 打印系统)

安装 hplip 相关:

~ sudo yum install hplip hplip-gui

之后使用 hp-plugin 命令使用绝对路径安装: hplip-3.18.6-plugin.run (注意:不安装插件会导致插件安装失败, 此插件如果在线下载不成功)

也可以下载 hplip-xx.run , hplip-xx-plugin.run 来进行安装, 推荐使用 curl -O 命令下载,并 使用 chmod +x 添加执行权限。

chmod +x ./hplip-3.16.11.run
sudo ./hplip-3.16.11.run

安装samba:

~ sudo yum install samba

并进行修改配置如下(例子,可以单独修改):

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it. [global]
workgroup = WORKGROUP # 重点,windows 打印服务器一般默认用户组是 workgroup
security = user passdb backend = tdbsam printing = cups
printcap name = cups
load printers = yes
cups options = raw [homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes [printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask =
browseable = yes [print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask =
directory mask =

添加防火墙规则:

sudo firewall-cmd --add-service samba
sudo firewall-cmd --permanent --add-service samba
~ sudo firewall-cmd --reload

启动 :

重新启动 samba 服务:

~ sudo systemctl enable {s,n}mb.service
~ sudo systemctl start {s,n}mb

重新启动 cups 服务:

~ sudo systemctl start cups

可以使用 systemctl status  cups 命令来进行查看服务状态。

man cups :

NAME
cups - a standards-based, open source printing system DESCRIPTION
CUPS is the software you use to print from applications like word processors, email readers, photo
editors, and web browsers. It converts the page descriptions produced by your application (put a para\u2010
graph here, draw a line there, and so forth) into something your printer can understand and then sends
the information to the printer for printing. Now, since every printer manufacturer does things differently, printing can be very complicated. CUPS
does its best to hide this from you and your application so that you can concentrate on printing and
less on how to print. Generally, the only time you need to know anything about your printer is when
you use it for the first time, and even then CUPS can often figure things out on its own.

添加打印机:

安装 cups 后,可以使用 cups web 服务( http://localhost:631/jobs/ )来添加 打印机。但是我们已经安装了 system-config-printer 我们可以使用此gui 界面来添加打印机。因为我们使用打印的服务器是windows

打印服务器,所以我们需要使用 smb 协议来进行访问网络打印机,输入凭据,选择驱动。具体的配置截图可以参照如下博客。最后添加打印机成功后,可以打印测试页来进行验证。如果没有成功,请参照系统报错,进行修改配置。最后祝你使用打印服务愉快!

保持更新,转载请注明出处。如果本文对你有所帮助,请点击右下角推荐给予支持。

参考链接:

https://blog.csdn.net/allan_bst/article/details/72026980

https://blog.csdn.net/gaoprincess/article/details/79591632

https://www.cnblogs.com/sztsian/p/3462170.html

http://www.mintos.org/hardware/hplip-skill.html

http://www.mintos.org/hardware/hplip-cupsext.html

Setting the printer: 2019.8.1

Fedora 28 打印机配置 ( HP pro 1136M ,基于Windows 打印服务器使用 smb 协议)