查看: 2082|回复: 6

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

[复制链接]
发表于 2025-4-19 22:27:36 |河北| 显示全部楼层 |阅读模式
理论上群辉应该也可以。
+ n0 t: S8 e7 e! N, c2 k1 @4 r+ ]5 Y
/ A% W; Z2 r+ ?6 v& T: O我是用PVE的LXC模版。& }- A2 H# Q+ G, }
PVE版本号:8.4
+ p. w3 W/ ]& x* n7 RLXC是Ubuntu 18.04.3 LTS/ e) s7 g5 k5 E7 S1 l8 @. x8 H
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
+ n' ]2 G: J# T: J+ ]每种版本对应的不一样,这个版本的换源是* @2 \. [: \0 e7 q; ?
打开文档,注释掉原来的源; b% U6 n) M3 x# b$ P5 k$ U4 e! k: d% _/ Z
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:
: e# L- `, u# r
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    2 J6 O" W* l! W* `1 _8 I* v
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse0 a0 `- h& L4 R3 B/ r- }+ H( g
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse# T  ^# x# Y- w. u
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse( b) s+ h5 e; {, g1 r8 _
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse2 A% }, b' g$ T$ |; b* R
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse# y5 _" O5 L5 r( A+ g, o. M$ y. n
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    $ N6 d' d+ O- a
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    3 l. N8 [3 j# P
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    ! ^& G. _7 u; w
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:
6 h, j4 ?# c  _& L; d1 m% q
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    ; y# Y3 n) V1 X4 K" I  {- ]" h. B
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    0 M; C4 m; D( A7 w
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    4 [8 h* S* U) B6 D% L* }3 a5 e
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    ( A8 ^* [- d! k' Q
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse: l; j4 x; _1 ^, y2 ~1 o
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    : @, ^: x% f9 k/ ?& c* v  X
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse0 K, J, C) z: Z  `+ \* X, ~/ t* @! q
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse1 w3 K$ ~* M! s* j; r. w
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    & U% r! d) @' x% P
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse2 D- O) s7 R8 ]* i  H, t' }4 h+ r  S
复制代码
中科大源:
' D/ D! u* b% p6 J  l, i
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    $ v( m! \/ M7 R' b7 e/ l' \
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse+ Q5 ]; k5 R8 J# u( C4 k" a
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse8 s( G3 C2 J: ?
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse+ @) F% L' W, T6 r" S
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse+ G1 T' R" {7 U' L7 Y6 A
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    % f2 r* l8 y. Y: i
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse6 e8 w- S! g  @  I' l7 c2 M1 h0 S
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse, F( ^1 Z' V+ V4 d8 l5 m
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse9 m# M" e" x" \! u6 G3 y
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:
, t. Z* ^+ [. X+ |0 i! `8 m; q
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    # I9 z5 f8 ?2 U3 }: G1 w
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse& v2 @/ c  y; z$ g# x0 G9 ^; g7 K" B
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    6 g  L8 `# C9 n7 }" D
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    ! _. X6 I' H) {' T& L3 f. d9 [8 N
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse+ v  D: u9 ]) h6 E2 r) ?  G" ?
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    ) R/ d" e! J7 ^" ~
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse/ w/ `0 }% u& j: j2 w  H* ~" H; k
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse0 m6 X3 g: x4 C
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    + ~( Y( ]( j( e# ?- _$ D
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令
+ @" C, K. i% }- p9 K  I
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB8 `/ [. Z2 K, ^% u" T
PVE的Shell输入lsusb查询打印机
" ?; v5 G3 m& _3 G, ^- w
  1. root@pve:~# lsusb8 x4 R3 q( E4 C( Z* {& d3 m2 T4 w6 b
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub" x) q% Z2 j6 |) D- r
  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# v: b/ I4 X4 B$ F
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
- y5 v9 D! u7 E* A; m0 d% m+ E/ aPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定* ~4 J+ ?3 w+ ~# ]
0 }* w# U% W) \) W4 d" X
启动LXC安装 CUPS 软件及打印机驱动8 z/ }2 n& E2 {$ y) B
  1. apt install cups hplip -y
    9 o1 B8 G( o( L7 m+ ^; s
  2. systemctl enable cups+ X- G8 |9 s. U$ Z
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件# K9 p$ `# O9 O% Z
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改
7 @1 x( b0 ]# Z* \- u) c4 W  D# Y0 A( O
  1. # Restrict access to the server...
    . D+ f- A: L& J) Z
  2. <Location />
    8 z* }4 h4 @' Y' k3 M
  3.   Order allow,deny. q1 k$ t1 \/ \: F
  4.   Allow all
    ' P) U4 }% n; E% N/ R4 Y1 d, c: V5 j
  5. </Location>' }! e2 N+ B7 X7 T( R9 K' O
  6. " g  d- p6 S* K+ L1 @4 F+ J
  7. # Restrict access to the admin pages...- ]3 f% C( b8 ^; Y( C* n" i
  8. <Location /admin>9 @; C' H( z; Q7 A* ]
  9.   Order allow,deny
    - @- ]& F& c. ?
  10.   Allow all
    $ B* x" @3 |9 V! J* |- h' m
  11. </Location>
    9 S- t- b0 l/ P9 Z6 L2 [; A: E

  12. ; b* {/ s' d% u; x- e' Y8 L7 y- f
  13. # Restrict access to configuration files...1 _( ?/ R# h1 }) d8 n
  14. <Location /admin/conf>6 L, f: P) x1 o6 ]
  15.   AuthType Default
    * u1 F/ F5 \- _) v
  16.   Require user @SYSTEM
    ) U# y8 ?# B1 C
  17.   Order allow,deny
    + G* x- V1 J/ S
  18.   Allow all* `$ s' y. Y5 T/ }
  19. </Location>
    , u5 b0 e. @) e( h- y

  20. & K( {' j/ U; }9 w8 n/ L% e/ a& h
  21. # Restrict access to log files...
    & {3 f7 F( i5 p/ G
  22. <Location /admin/log>
      ]. b6 ~# s) k+ w
  23.   AuthType Default
    4 S9 v: m3 G4 }2 v. n! ^& ]
  24.   Require user @SYSTEM
    5 |, R: ?  g6 M2 {0 o$ u1 m
  25.   Order allow,deny
    * l. m( T6 ?5 @
  26.   Allow all
    1 H" _0 |0 ?1 T. s: T) F- P
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
9 U. \0 S, N7 G# l
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动
$ N7 |4 s; J0 H" S
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压/ `) J9 X, n# d4 }
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录0 D6 M/ k) g) m5 m
  1. cd uld
复制代码
给个权限
6 l+ i6 W$ H7 V# @9 B6 X
  1. chmod +x install.sh
复制代码
/ V! L  M' D9 n. o$ l  N
安装驱动* l8 b- u2 k& d! k7 o9 e8 k
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。$ D) H5 O& q; r+ [
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码5 T; _0 `: V- ~3 g1 G  c8 @; n( F. D
添加打印机就行,驱动选择HP Laser MFP 13x Series7 x4 D* G6 N+ h
Ctrl+F搜索“13”容易找到。) n5 z# _9 \. U
设置好后,手机也可以打印了,不用下载APP- |$ Q8 F2 r/ M7 U: H. [' I7 i
电脑添加打印机是(举个例子)
: @2 K8 y& T" c2 ~  X( g
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的
8 \/ @$ }. [! l( A+ Z
  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这些轻量级的固件不香么?
& P7 w  I! Y8 ?8 o
7 G" @4 T( G8 ?, k: r( @$ ~3 h& ]- A9 J5 G% {8 a
二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 |河北| 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28- V$ B; _  n0 K- @
装OpenWrt/DD-WRT这些轻量级的固件不香么?

# F! p2 S8 V, A. J! ~装过。旁路由经常不用,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客服返回顶部