找回密码
 注册

QQ登录

只需一步,快速开始

查看: 134|回复: 3

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

[复制链接]
发表于 2025-4-19 22:27:36 | 显示全部楼层 |阅读模式
理论上群辉应该也可以。9 Y" F2 m1 L$ s  Y9 I+ X% G
1 v3 _: ~: Z6 {) R) d8 h: l5 n
我是用PVE的LXC模版。( D+ k" X; `# ^( g. R6 f1 k: U
PVE版本号:8.4
* S' S4 K$ [2 y4 L( D: f2 gLXC是Ubuntu 18.04.3 LTS/ R/ x7 @- X* I) Y" \7 M( s. c
因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。/ J% E' \/ N/ `0 `- R# s! {' m7 w5 @
每种版本对应的不一样,这个版本的换源是
' a( B! f( Y0 O: u- ?打开文档,注释掉原来的源, c9 U3 @) }2 i3 f7 }2 F7 c
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:
: {/ O2 T9 j  X$ i1 ?
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    1 e7 {& U  \9 \0 I4 E
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    5 ]2 T  B& G9 y2 w9 g% J5 d' c
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    # }1 A& j# e6 R; N+ T  f
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    5 @* f) u2 b  x5 p
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    ! ^0 O& p3 \" e3 P% o  e: ?  y, z. f
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    $ K7 P. v. A5 u! R# f5 f
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    & v9 \& Q& B2 e( ~2 y/ Q2 F
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    " D1 a5 a" H2 Q3 `( N
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse2 x. r- A: h5 S, c- L) {( a# N0 z
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:
- z5 G1 f: d% o6 ^5 y
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse7 Y' {' q8 `; e: l5 x3 R
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    $ \3 k* g2 N: G. a
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse3 L$ E8 J. {: d: ?& h6 b4 {
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    6 `% u: J3 @/ g1 K
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    9 G, U  J- I* j
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    7 h4 ?) ]; A4 ]4 l5 ~) g
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse  H& }) p+ @4 q/ c( _
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    9 `# `% Z% _0 z" S) T# j
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse/ J0 w. ~3 [' H/ U$ P
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse6 `2 [& _( x4 Q* _
复制代码
中科大源:4 u8 Y& q) }5 S  u; q3 m% v
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse2 n% O- |. P! E9 M
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    ! b, |% Y* }. X. a6 f# _+ t
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse  V6 l6 F. O- J8 M  P
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse' l1 _* J7 F1 E: _
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse2 K1 ^( z5 _" m( t' q. D8 B0 C
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    1 S  L4 }  c# I+ B
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse' v/ |" \6 |2 \2 a
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse  L; l: }1 T0 j3 i$ ]
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    % q) y: X5 C6 L: y6 Z
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:& u# V1 Q8 s/ L- ?+ g8 o
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    + u  D' P: A% j/ I
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse; @7 u2 S  m+ ?$ \$ P. Y; m
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    + `" m: w  P  _' n: _
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse& J" e6 V1 [: u- I, ]
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse8 V) v0 Y; {. [5 n' m1 L  v3 [% z( n
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse2 z& y8 \' k0 K9 C# d; g' T
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse  Q' r- k2 Z, }1 D2 k
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse0 F6 A% v9 F3 ^
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    - t1 U: I8 j% v' Q( ~
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令
/ J( l2 C1 S2 t' L+ K) ]5 {
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB/ I5 L  O) v, w$ k! j' @6 ~4 w
PVE的Shell输入lsusb查询打印机
' `" Y  M* p" ^1 s6 o
  1. root@pve:~# lsusb
    & f. i: x3 S& |! r& R7 B" u
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    - j7 U- x; l  E3 {, }3 U) p
  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
    ' l: S' f6 X* e( r
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
+ {% w, [) c; kPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定9 J( l3 d+ [4 D; m( Q

- @0 u: q5 l2 k启动LXC安装 CUPS 软件及打印机驱动
' L; m+ A' S  j0 r: l
  1. apt install cups hplip -y+ t8 n1 Y. C( g7 c+ }
  2. systemctl enable cups, m- n, Z/ M$ `7 g$ @5 K! L( c
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件5 J9 |* k# z; a6 G. e7 x+ y# ]
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改  H( y: M& l! a- m: Y
: a5 ~3 I1 x9 f2 R2 ~( u2 T+ L
  1. # Restrict access to the server...0 h' }/ F$ y* A( y6 w2 v
  2. <Location />
    + x3 t. Q2 @: t5 K# A# \+ M, z
  3.   Order allow,deny" t: a( Y: |+ r  ~+ p
  4.   Allow all
    ) m$ E& Q2 H5 \2 Q7 m
  5. </Location>
      E/ P7 Z) J0 i5 y9 N* \. F3 \
  6. 8 C- ?1 k* S  Y4 R% B# {
  7. # Restrict access to the admin pages...
    ! l8 [0 K4 e+ d; n3 }9 h8 {
  8. <Location /admin>3 }7 i( f: s6 v7 M" P
  9.   Order allow,deny! D7 v3 V% n9 K  z
  10.   Allow all
    , c3 _/ v, i  J2 P' U
  11. </Location>
    $ [% ~" J1 Z' j& T, G
  12. . j; B: f, Y# G. k- t. t
  13. # Restrict access to configuration files...+ {$ o4 b/ I. `+ n& V- O9 {
  14. <Location /admin/conf>6 O. D4 c  \% c3 W
  15.   AuthType Default
    ) X: m. R% t" O
  16.   Require user @SYSTEM
    1 M6 ]! p+ Y9 H" s" y6 g: L
  17.   Order allow,deny
    # h) D7 k6 Z2 w
  18.   Allow all" A1 P6 f  S% C  Q" [5 I% b
  19. </Location>% L- o# ]$ K' O) `
  20. 6 h% Y* X7 k# v! T
  21. # Restrict access to log files...
    ; i8 O+ |0 C+ q" }( ^/ C
  22. <Location /admin/log>
    6 r: l# h% I( l
  23.   AuthType Default; {3 h  C) i- t
  24.   Require user @SYSTEM
    ) Y+ O& Z" [, I% r7 r/ u
  25.   Order allow,deny
    * Z2 c) V3 i* M0 N6 B
  26.   Allow all
    ! k. K; s* U$ ]8 G( C2 J6 E6 C
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS) a5 N% [  s7 M1 g8 _( M5 i
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动
( ^9 r3 c# }* Y1 h- ?' E  @0 E6 R
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压0 k- j9 s3 V) Y  e+ [
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录. L+ e, |6 r% ^. c0 Y9 |
  1. cd uld
复制代码
给个权限
- l% O2 `& d9 v: `) K# g, E
  1. chmod +x install.sh
复制代码

2 ?7 I2 V. ^/ g" b; b( g安装驱动
( }+ a4 E5 }% h* c' Q# o7 W  x
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。
: ^" I  K. b1 Q9 h: K; W安装好后打开CUPS界面,账号root,密码就是lxc设置的密码% }% Q( a) F: k* z
添加打印机就行,驱动选择HP Laser MFP 13x Series. E/ c6 i- `) _( O! V
Ctrl+F搜索“13”容易找到。
1 v9 E: _+ a( G# e9 ]2 \6 n+ f) M' U设置好后,手机也可以打印了,不用下载APP- L: S6 u- b  ~$ j9 q0 f
电脑添加打印机是(举个例子)
9 h) w; s* u3 t( \
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的
1 P: V" c: F5 V3 B
  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这些轻量级的固件不香么?4 }) m) e1 ^1 M9 K. o

3 ~0 v3 a* A+ q- q7 U# n4 L6 O* o# W3 d. o  O, C/ T
二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 | 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28
( H4 M2 Q& p2 u5 E- v3 h6 I装OpenWrt/DD-WRT这些轻量级的固件不香么?

6 r0 B, h/ A- C+ |( P9 S, ]装过。旁路由经常不用,adguard是常开机,所以和adguard装一块了。
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|宽带技术网 |网站地图 粤公网安备44152102000001号

GMT+8, 2025-5-1 15:18 , Processed in 0.037899 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表