查看: 1564|回复: 6

PVE安装CUPS打印机服务器,解决惠普136A打印机驱动

[复制链接]
发表于 2025-4-19 22:27:36 |河北| 显示全部楼层 |阅读模式
理论上群辉应该也可以。; j$ u: ~# y0 t! O

# d* z: C- M; X. _7 H/ T我是用PVE的LXC模版。3 }! L6 p$ g1 M( W
PVE版本号:8.4
& V' L! U' F7 k4 G/ HLXC是Ubuntu 18.04.3 LTS
5 I# a: @) D( g* H9 K因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
% S$ V) c+ ?: P* a+ z# b2 T每种版本对应的不一样,这个版本的换源是
( k/ C- ?3 A# P打开文档,注释掉原来的源3 i: p9 \- n' ]( \* k& w9 O
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:4 Q3 [, q' w5 Z
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    8 M* K& N3 q% ]
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    8 ^- N/ i" L& [
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse* ]. c4 e, n. F6 n3 N6 z
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    ) S& X' w) v$ K; T) {3 E/ f& d
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse* ?- {+ b+ H7 x. j  F4 j1 ~
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    - }! t; D% P, }+ d* T0 `
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse. ^0 c1 k$ y  W, Q6 B+ {
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse* c2 j+ x& {3 n0 }# _1 L& {
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    2 S" b# \* H, }; V8 B5 ]
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:% @' m4 t5 ~# F8 q2 M! |: W
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse: _8 i. u# q2 ]7 C
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    9 K( P! R3 P5 s
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse2 [: p& {, s& Y6 r5 f* |
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    ! q6 x. G& K2 x$ b8 `3 ~/ {3 I
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse* n8 c, y  ^2 W0 `3 s. q
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse1 v" j  ~1 e. c" t
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse5 M, A  Y" r) I2 s
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
      f4 ^& C$ T" {6 j' [, O
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse8 G% k* u/ f% {- Y6 K/ |! P  n
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse. W: `9 l: R5 H- J4 N/ s7 W  q/ C
复制代码
中科大源:
9 ]) Q- H0 p* F( a4 J; q
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse; |" Z1 G+ p0 y: j) a5 I. r" @
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse7 T' A4 S! Z& s; W7 g- @4 K, d
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    # e- G3 l/ B2 a
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    & `# C# ?! ^. r( n
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    & d  E6 r5 H7 F/ K# s. y
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    - A0 R' [, `$ {
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse, d8 T( A( c6 v/ ^- C7 z" g
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse+ E1 k& ], ^$ H9 k
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse4 U- z% J" ^, t7 t6 p
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:
) d! O: R/ w/ |5 c& Q" x0 L; K+ `
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    ' S3 Q- b& x% \2 e! Y! j: J: f
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse3 A( [$ w! K; x  w! V$ Z
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    ' |+ r" N+ n5 }3 {# D2 j2 J
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse! s. }! \0 M, R% g' d
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse* ^; J! n1 P* u  G; l
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    8 a0 D7 Q: V5 o; O% T9 _7 k9 d" l
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    3 d% p2 n4 f: m  O
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
      X/ e4 A! |5 i% ?
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    / W/ A' h5 d7 d, X' A
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令4 `5 ?: r3 O3 V% n! c# V8 j
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB' M2 A2 X' `/ M+ w  s. E
PVE的Shell输入lsusb查询打印机7 o* i5 t! d4 }& a" M4 G2 W- N- ^
  1. root@pve:~# lsusb2 `4 l* d" X' f3 P7 j
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    ' I( P4 o. V) a* E9 n: y6 {
  3. Bus <font color="#ff0000">001</font> Device <font color="#ff0000">003</font>: ID 03f0:f22a <font color="#ff0000">HP</font>, Inc HP Laser MFP 136a
    3 E. E; _! M& T' d; T& \; c0 Y! T
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
" `& X0 @5 G: S7 f4 YPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定
) n" ]% y, A# A8 }7 L* M
' j: l( r( Y9 k. ?启动LXC安装 CUPS 软件及打印机驱动/ M9 ]' O/ o+ O- o" i4 b0 m
  1. apt install cups hplip -y4 \4 d1 H* o: O6 q' o
  2. systemctl enable cups
    1 j2 i/ w" H, H$ X* G) c
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件
4 D/ `0 F  ]+ v9 J
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改
* L1 q* i, R; w8 r- J$ E: A0 N
5 ^& v' R8 s* Q. ^2 v' I7 h: y
  1. # Restrict access to the server...- ]# @. v* H' a# n; h# u
  2. <Location />
    . }3 p% S) y  Z& n4 t6 {
  3.   Order allow,deny
    ! q. L' A) d/ p: i9 X0 j
  4.   Allow all
    0 O; d; b, D% d
  5. </Location>/ K0 O# F/ ]. V8 k8 W4 Q" Q! n

  6. + A8 A1 B% N  w1 e7 u, n9 I
  7. # Restrict access to the admin pages...
    : [4 P0 q0 _' t0 f! a0 v# |2 n% ^
  8. <Location /admin>. W8 `8 k/ t6 H9 b8 g
  9.   Order allow,deny3 t. e; c9 N) G3 y0 @' v, [
  10.   Allow all
    " X9 f& H5 P/ p$ w) y  n& K
  11. </Location>$ v1 C* \. q6 ^
  12.   c" Q7 a3 x9 s4 c
  13. # Restrict access to configuration files...# {/ s3 }4 _! F, i# _! ?
  14. <Location /admin/conf># Y, V  W+ U- U
  15.   AuthType Default0 j; t5 M' P% i3 V5 d; ?! C5 L* V
  16.   Require user @SYSTEM
    8 @& U, `: J$ [! v
  17.   Order allow,deny( B0 B4 K5 M7 k
  18.   Allow all
    - K) |, f1 K9 F9 a
  19. </Location>
    % P5 u5 ~/ e( V
  20. ( M1 e' Y: \" S7 W& K3 j9 z( e
  21. # Restrict access to log files...
    , r  @+ O5 G8 w1 X1 |9 _: d" P
  22. <Location /admin/log>
    2 Y3 h% F  S0 `4 M: |+ _
  23.   AuthType Default
    ; H8 P& v7 Z5 p' j  A- o9 {* u9 `  L
  24.   Require user @SYSTEM
    8 N" ?. I& x0 p0 q  X
  25.   Order allow,deny
    ( ^) S6 x* I8 |# [% U
  26.   Allow all5 m; |$ H- {/ r5 W
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS& X) l0 d' y" a- u- r6 N
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动
  f" x1 j. g$ Z2 h
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压0 W/ Q* L$ m2 j/ t1 \
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录" b+ ?# V5 [0 N8 p/ _; i, Z
  1. cd uld
复制代码
给个权限
7 e; k1 A8 q8 ?. V
  1. chmod +x install.sh
复制代码
$ R7 D7 H7 c: |5 K* {
安装驱动: l1 z4 z: {7 G- Y
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。
/ e2 T$ n1 U" i& s- E- e( ^' e  n, h安装好后打开CUPS界面,账号root,密码就是lxc设置的密码% R+ S4 s7 w# M7 l+ ~7 n" y
添加打印机就行,驱动选择HP Laser MFP 13x Series* U' W2 V6 d5 n8 `
Ctrl+F搜索“13”容易找到。
& ^" Q  I$ T8 \设置好后,手机也可以打印了,不用下载APP2 k$ G- ]: @5 }% x# c$ X. s
电脑添加打印机是(举个例子)
# ~4 _. C+ \$ c5 [9 u1 f1 f( Z
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的, [3 c' {5 L3 J9 {" O
  1. 192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机相册里可以直接打印了。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 2025-4-20 09:24:14 |山东| 显示全部楼层
不错,谢谢分享
发表于 2025-4-20 11:28:36 |北美地区| 显示全部楼层
装OpenWrt/DD-WRT这些轻量级的固件不香么?+ l9 Y+ J+ z* a& w0 R$ W* T

4 l0 h! U5 Z* E- Y7 j, Z& Z% Z. L1 M  w+ d7 u
二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 |河北| 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28( Q: C' T2 y2 _: i# g
装OpenWrt/DD-WRT这些轻量级的固件不香么?

- m1 k8 ~- z4 `+ i装过。旁路由经常不用,adguard是常开机,所以和adguard装一块了。
发表于 2025-5-27 09:55:48 |安徽| 显示全部楼层
不错,谢谢分享
发表于 2025-5-27 20:33:09 |安徽| 显示全部楼层
不错,谢谢分享
 楼主| 发表于 2025-5-29 06:50:45 |河北| 显示全部楼层
2025/5/29更新,还是有些不好用,海鲜市场入手了小白盒,好几天没和媳妇吵架了。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

相关侵权、举报、投诉及建议等,请发 E-mail:yesdong@qq.com

Powered by Discuz! X5.0 Licensed © 2001-2026 Discuz! Team.44152102000001

在本版发帖QQ客服返回顶部