找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1026|回复: 6

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

[复制链接]
发表于 2025-4-19 22:27:36 | 显示全部楼层 |阅读模式
理论上群辉应该也可以。
: v; H; ]/ c5 O9 p9 X5 f+ G2 `* z* n3 f9 c4 I
我是用PVE的LXC模版。2 K9 d7 {, p* `" i* E; X
PVE版本号:8.4" o7 M/ u- i1 p
LXC是Ubuntu 18.04.3 LTS
! o/ p1 `2 G, Z* x4 P# D$ N, [" }, N因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。4 D* G" z5 g7 m+ x( v# m  @, R! c
每种版本对应的不一样,这个版本的换源是
: E! c4 ]$ u, B5 o9 p打开文档,注释掉原来的源
  n2 r- P* V0 S8 f8 @0 S
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:* D: Y" K7 H) ?+ k' g' f
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse( `6 @: {' Y: t/ H+ T' U/ n
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse! L- w+ n7 C* X, f
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    + P' G5 J; C  _9 C" ?
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    6 G. g7 Z8 Z$ i  p! C& A1 E
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    # V" v* S5 D4 r3 p& z: U9 F
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    6 z* {- f. d* `3 }0 a! T
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse* U4 O& ?) W* H
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    9 e; Y: k. c8 f' o5 s$ S
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    6 k( o5 ]1 \& H% Z
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:
1 q! t5 Q8 B# q/ U* g* ]2 _) A
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    6 B  @* g' S1 q- b4 X
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    7 M5 L% z6 {( y: U: [4 q
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    # f, X  Y& r. D
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse5 X9 D7 Z* G. f, r8 o1 o" }
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    9 j+ T1 O3 j9 T* }! l
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse& M7 V9 C6 k; |: Z
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    % I4 |. v+ U# n
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse2 B9 ?$ I. ^: U; E! ]
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    ' c% n" |% i2 H7 r
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse6 S1 L, Z1 c5 e
复制代码
中科大源:8 q5 w# z1 ~0 N6 J
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    / T' R$ @: a& q4 Q7 \2 s) D/ ]
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse5 q  v$ ~& _8 r$ K( z, c8 E  C1 d
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse2 f8 D+ Y( l, a! ]4 p
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    - l' F& @+ G8 I
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    2 x' m+ k: `, W% L) \- w$ d
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse& N* U" }% ]# U1 d
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse* l+ @& R7 x: f3 X+ m& M' B
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    5 X3 H7 R; w) \8 f! ?5 H  ]8 V0 V
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse* r2 x5 j5 m& I- l3 n4 H* \& o
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:: ?$ {- f0 V9 D  U; U' }
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse( Y2 g- h% B' H3 @6 g, H
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    6 e" W/ `+ l- A3 w
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse. S; G4 a* M- V2 C# G
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
      l7 P: H) t3 C- W) W
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse* E( |5 n2 Q7 s. u# G
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse' s; n1 y5 r! C7 _/ T7 p2 o8 e
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse; X: I0 l1 H" F" }4 a( g
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    5 v$ x% M9 J* _# p1 |
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse. X4 n* t0 F9 U0 I, X, x
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令
" s6 L( Q* E  k3 F: R! z
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB1 r2 O( Y' v  x! X
PVE的Shell输入lsusb查询打印机+ {4 P& P9 m  H1 q
  1. root@pve:~# lsusb
    ; f& L7 v& u" [. v& o5 |8 R9 [
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub3 |9 _6 M& B) G( p! B
  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
    ) P9 i3 R! J" S+ z2 K
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003( K( }4 j$ d$ |/ g/ ~9 @1 s6 g
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定
& D7 x- H4 ~  ~9 l) _5 _  p) h
& r: h5 R, q) R  ]/ {7 m. S1 O启动LXC安装 CUPS 软件及打印机驱动
( F% r6 w0 E4 @. a4 o
  1. apt install cups hplip -y: k' b4 I  w- z2 R4 G6 q
  2. systemctl enable cups( Z: @+ J+ j- s1 G4 n: a
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件
  N. ]* M1 k# N+ C% w6 a
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改% q' i- b8 w2 K7 m$ I
+ p/ u  l& @1 |- }% \) w- ]
  1. # Restrict access to the server...! d& r& z' A  v/ S: T1 t8 g8 ?
  2. <Location />  \3 ]  k' F' w6 C) }
  3.   Order allow,deny
    : m: }- p3 ~( L2 Y9 R. x" J2 G
  4.   Allow all
    : P( K0 U0 Q+ @, P) C
  5. </Location>
    ( G  ?) S  A6 j" B4 b9 H% x5 [. c: p

  6. ' v; m8 r+ c8 J+ S/ |7 ]2 Y; X
  7. # Restrict access to the admin pages...! ?3 E0 B; i( X/ e  q  ]8 ^
  8. <Location /admin>
    & q! d- H3 u6 K' @, T
  9.   Order allow,deny' R* h0 |- r( h  x/ c/ F. R( V* A
  10.   Allow all9 ]$ Q4 j4 N- j2 f- m4 p
  11. </Location>
    . ]7 C( U6 H4 m; O% K/ }' |
  12. 7 [9 d2 f$ ?. v& X5 x% z
  13. # Restrict access to configuration files...9 i8 @& Q% g" `2 G
  14. <Location /admin/conf>3 h' f# _' S0 R  f, f! Q
  15.   AuthType Default. u* {, r3 ?  n  D( d# |
  16.   Require user @SYSTEM
    ' y8 w* d6 K! G. {! f; j9 I. _
  17.   Order allow,deny
    % w5 q1 w1 l2 P5 i7 Z& [4 ^9 ]
  18.   Allow all
    + }! L0 M, r& H0 ?# t; s/ e( k* G3 X# p
  19. </Location>
    8 a! W# p* c# h" [, U8 {0 p
  20. ( o1 ?" H, g4 U6 H  f3 W
  21. # Restrict access to log files...
    # Q. ~% b9 J6 |: f
  22. <Location /admin/log>9 i+ k0 ^' B+ D. s0 e
  23.   AuthType Default
    8 E5 ~, ^, s4 ^$ M; m3 L8 t
  24.   Require user @SYSTEM
    8 a0 Z( z) r0 r8 H" F$ W% s
  25.   Order allow,deny6 o" t3 {2 }5 k4 W2 h) z
  26.   Allow all
    " k" K, Y7 O: G3 \2 R5 W
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
5 v  X0 S' S1 r5 F' Z- v2 y8 D
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动- L5 o. I8 T; i2 J% J, z+ T
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压
' V! @0 g: h) v
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录
) z& W9 _6 e+ J# {* P, z1 c
  1. cd uld
复制代码
给个权限
$ d9 ]6 R0 j; C# r& v- V( ]
  1. chmod +x install.sh
复制代码
4 H, Y# d" b3 P8 f3 \, Q
安装驱动
, J$ ]: e1 g3 \5 ?
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。4 w9 H! d# {% g+ |- s! y; U
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码; \& m" m4 j7 x- s
添加打印机就行,驱动选择HP Laser MFP 13x Series
) O/ f" J" A& X) N3 m$ aCtrl+F搜索“13”容易找到。
0 T4 o. ^" S; I, Y5 w  S& x设置好后,手机也可以打印了,不用下载APP
1 m  H8 r) `, R/ v% G电脑添加打印机是(举个例子)! N) k+ @0 _5 G
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的1 U1 q" t* _# k3 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这些轻量级的固件不香么?1 K! S) W! r6 N6 N* s+ J
  x8 T* f( \# z% k0 [
) t* P& F5 H3 h& o7 D' F5 }. P
二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 | 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28
6 t; K6 P: f; J! o0 q5 u+ I, n5 W装OpenWrt/DD-WRT这些轻量级的固件不香么?
" n  W0 t. |' A" T# l
装过。旁路由经常不用,adguard是常开机,所以和adguard装一块了。
发表于 2025-5-27 09:55:48 | 显示全部楼层
不错,谢谢分享
发表于 2025-5-27 20:33:09 | 显示全部楼层
不错,谢谢分享
 楼主| 发表于 2025-5-29 06:50:45 | 显示全部楼层
2025/5/29更新,还是有些不好用,海鲜市场入手了小白盒,好几天没和媳妇吵架了。。。。
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

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

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

GMT+8, 2026-3-16 11:27 , Processed in 0.054146 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

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