查看: 1428|回复: 6

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

[复制链接]
发表于 2025-4-19 22:27:36 | 显示全部楼层 |阅读模式
理论上群辉应该也可以。
' s4 }+ r! M/ h& z: [+ \# K" {! l5 R3 t' A" y( M6 y; H5 y' d
我是用PVE的LXC模版。% C1 |. b7 f  C6 G% `
PVE版本号:8.4& b/ t3 X/ y2 b+ e* Y, O) ^
LXC是Ubuntu 18.04.3 LTS
& c+ v& D4 h+ ^% s0 A+ L因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
6 E) a3 A/ }; V0 f/ I# _7 A每种版本对应的不一样,这个版本的换源是* w8 ^- C& P! z0 q
打开文档,注释掉原来的源
3 Y# a5 W! Q" f$ Z
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:8 p3 d! N" `4 M# {) G0 ~. z/ P* p
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse6 o/ l7 |; S2 G4 ]4 [" l, q
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    + R8 r  W, ^6 K1 {* C3 S
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse1 j0 v# f1 L* p7 `
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse' T7 j  r' `$ Y/ p4 `
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse: a' u0 j/ z# M" A
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse4 Q' @- n! e$ g7 v: |3 T) v
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    ) p' H6 A8 x: {8 O
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse3 p0 A+ ?' l& v8 M4 o) X
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse- N& L6 E/ a  ^, q
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:# e9 ?0 L( g1 @3 I; n2 f
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    ! Q8 r. U# t: b5 h% s5 s
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    ) a8 B  M6 g. U3 ~+ D: G# o/ p7 v9 ?' y
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse. S8 z: l0 H, e. n
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    " F+ k: X0 u& a( h5 f! H
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse  |* M7 t2 O: o! q4 M4 \/ h
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    + z# z" E) o) ]  Z# y
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    ! \9 G0 S7 f( r7 ?
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse: p7 ^3 M' v2 M) s# }
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    ( h9 \% S; m6 T2 Y' K: g. \. F
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    9 g: \( V  x! B
复制代码
中科大源:
( S& w9 v4 }& Q8 w! `
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    1 W3 N1 B4 g' C, s# d$ y2 W  }
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse9 W4 m- g" V8 |+ X) J% X
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    & x( ^  D* [1 s! x
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse8 z2 T' ^  r0 c4 d2 ~$ p" S4 Q+ t
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    / V0 l# e, M( S0 H# y5 _$ w
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    , b! i) G0 j8 u
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
      T3 r& D$ q% ?
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse  R$ p3 E( @4 d0 L% f
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse: b0 r- j2 v* H7 J/ R* C% C
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:9 W: u3 Z3 G1 G, L9 q
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    2 x, Z  `$ K$ s
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse/ I( G$ s6 E. q8 P% d7 p
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse4 c* Q( D+ d+ L
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    4 o. L" H9 \: r* D
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse  `, G6 E# {3 k4 H' |
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    2 K& w8 o$ v  v( G* }$ a7 [0 S
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse$ r! G( ?$ N8 i7 o
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    0 p; y" J1 T+ R" s) B
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    9 B# ~8 u" J1 J/ w/ A
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令
! R  j0 d3 i- `5 S
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB5 e6 v5 e+ N8 D4 w
PVE的Shell输入lsusb查询打印机
1 p( u1 h. O$ H1 r* S; W
  1. root@pve:~# lsusb
    3 O5 a' t1 w; c9 I# R  P
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    " O# @) E: r) i) A2 _
  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- Y  M" v* w( W, F& k: `/ v9 N
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003$ Z* P# N' l: b
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定3 [5 x8 c  g/ U8 a+ m  ?( D/ q

; F% A1 G, t9 w% r: Y+ r! }7 p3 M启动LXC安装 CUPS 软件及打印机驱动, m/ t9 |# U5 i% }$ _% I
  1. apt install cups hplip -y
    7 u5 O9 k) k  P- H) Q
  2. systemctl enable cups
    ' h7 M, t6 q: p2 G0 G( [1 V
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件
+ S/ a; E( M; \0 [- i% A
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改
! m! P( |. c: g( O/ T' U0 v
2 k4 M. B9 X* L% d  P
  1. # Restrict access to the server...
    & ?: L$ r& Q9 J# ?9 ?
  2. <Location />
    9 H7 ]9 v* [7 w$ G0 {
  3.   Order allow,deny5 g$ r7 t. ^1 S
  4.   Allow all
    7 T+ m9 s( X0 s0 Y. t! E/ a$ g
  5. </Location>! P/ o! m( ~3 c0 m, I
  6. , d4 {9 |; g* x$ R; s: u$ o
  7. # Restrict access to the admin pages...' _) ?' ~! ^3 n* {
  8. <Location /admin>
    . e' }) c) }8 z; X' h; ?8 @4 H
  9.   Order allow,deny
    * b& S' e  r8 n* z, A) H2 J' u; T3 a
  10.   Allow all
    0 b. T/ ]: l2 D+ b5 F: |
  11. </Location>; h/ j+ f% _" X# O' t7 Z! I
  12. 3 Z# g& L) ~& ?' J
  13. # Restrict access to configuration files...6 d/ D5 O: K& F
  14. <Location /admin/conf>
    " Y3 U0 G& V$ g& r" |
  15.   AuthType Default
    8 k* u) h# m- ]& f5 i
  16.   Require user @SYSTEM* C2 D4 _- h* [5 p
  17.   Order allow,deny
    " Y) S# `1 V/ B# a) e! N$ W5 a
  18.   Allow all
    $ j1 z- I3 @/ @$ m$ f
  19. </Location>
    # t/ k+ K5 j* G1 B% g+ E. G" q
  20. 4 M( r" A. B/ N* q1 n
  21. # Restrict access to log files...* @3 e  ~! f, T" L: S$ i  u
  22. <Location /admin/log>
    ; l" D( f# |( a, Q  g$ z& M
  23.   AuthType Default
    5 i+ ~* Q$ g- a# t/ }0 O4 s
  24.   Require user @SYSTEM
    3 v9 }0 A2 I5 b& V, K7 g
  25.   Order allow,deny
    6 w& S) l& ~; I! ]0 d$ T
  26.   Allow all
    - |9 }" R5 ]8 k+ x
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS; o2 ^& }/ t/ P3 D
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动
. ~( A6 s3 f8 r" P3 c
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压" f: c) Y* |6 ^
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录- W; d. `/ |* @$ H* H. H
  1. cd uld
复制代码
给个权限
: _3 {% b! A7 S5 D0 t3 h) {2 E
  1. chmod +x install.sh
复制代码
0 h) g5 ~+ n( F2 j
安装驱动
; \! q: ^% w* i$ p' X
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。; p' K8 y" D( j$ @5 c4 `& `+ V
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
5 @( g0 k1 _  \添加打印机就行,驱动选择HP Laser MFP 13x Series
! o  K! `- e% @/ VCtrl+F搜索“13”容易找到。0 ^# J# M3 c3 U% F9 E  x
设置好后,手机也可以打印了,不用下载APP* b0 C7 z8 _0 C4 S9 N& @
电脑添加打印机是(举个例子)
7 d1 B+ U% T; b4 z
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的
! P+ V2 H$ H) _
  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这些轻量级的固件不香么?& U* T/ z  B5 L$ }$ G
. O! w8 @( |$ x$ c3 V; X, w

- s: ^; Z+ u: o" b二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 | 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28" L* T1 j3 d1 I' W
装OpenWrt/DD-WRT这些轻量级的固件不香么?

+ h2 r6 T4 _- \, N( P1 d3 Z3 }' g装过。旁路由经常不用,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客服返回顶部