查看: 1837|回复: 6

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

[复制链接]
发表于 2025-4-19 22:27:36 |河北| 显示全部楼层 |阅读模式
理论上群辉应该也可以。
! b0 p6 ^& \3 r/ H, W7 L7 _% |' ^! f8 ?4 ]4 q: B$ Y' ~
我是用PVE的LXC模版。
+ D4 _, @$ ^  W  \+ m; tPVE版本号:8.4
. `( |8 }$ h3 y1 k; O( a0 K9 D0 MLXC是Ubuntu 18.04.3 LTS
' o) Q9 o/ k+ `8 X因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
. ]& b. ]# {; e6 @( s/ t& w* w- B* d2 q每种版本对应的不一样,这个版本的换源是
/ x" x0 z. F' n* H/ n1 r9 t打开文档,注释掉原来的源
6 V( Y% h* j1 c# n& B; X
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:. T# n- J# b3 \# D& f8 l- K& {  ^
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    8 D/ h% y& r+ S* q
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse2 K% _" [5 s- a7 y; e6 |
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse8 ]% A: C9 N( U, O$ {
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse' L0 e; }! z6 C: h1 Y# ^
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    , |* f+ z. @" n  J( N/ m% ~' ^# A8 H
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse" {2 u' q& {5 S
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    7 p8 a- z, x7 m
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    2 S  J) T0 |% @3 J) L3 {7 i) C" z3 n
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse3 [6 ]+ k6 C$ d* X2 z- n' H
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:
" {4 ]2 l( K' ^; F# f' o
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    # S2 v, j+ ^/ n$ v
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse3 g7 c' u( N$ j4 T" u* g
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    # o$ Q$ @, a1 Y, L7 q
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse$ `2 P2 m/ b3 y" [# U
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    7 q( Z1 O7 c& y9 _+ Q
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    # F( ]# f" u9 b" P! C3 n
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse; O$ |: I1 m1 X1 K+ d/ H# Z; t: o
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    $ t* T0 \* m1 v! t* o: V5 L: D' r
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse8 z8 n9 |' U' F
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    # y  P8 X/ O# _! P; \
复制代码
中科大源:
1 X" Q4 v0 E$ c6 ]; g8 X! \
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    . M  [% C/ a" ^0 ^; f3 [% C
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    + f. n" S1 z! U8 A: [
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse2 {0 U/ [) B& Q* `9 `
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse5 @6 r( S# T+ F+ @0 z. d
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    8 x1 }2 [4 v/ S- A1 R
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse# Q' m$ Y. @" v& k) R1 u
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse, B, m6 L; n* |% i/ E: f+ V
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse) Y/ Z% z, L  g
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse; s$ ]- |+ Y, w! p& ~
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:
) P1 Q+ f4 N! B. ?9 F) ?: I
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse$ P' V3 u- {% |& B
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    ' P- T1 S. ?' ^
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    ; b! O2 ~4 j9 ]
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    : h" Q$ w& ?; Z6 m; p
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
    4 m7 E* j/ I- T! O! X
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    1 A/ _& _1 K) U" k8 }* `1 F" s
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    3 m- ]0 j' _+ o# U% \5 Z- p- w
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    5 U) F/ s: ?% m# S
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    6 w5 @4 J& L0 {9 ^5 F8 N$ S. r2 X
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令: o: X# [& V; T8 l; r5 I* y' Y
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB
2 V& n% g8 k/ ]PVE的Shell输入lsusb查询打印机0 Z3 }0 D* W4 H- s: }
  1. root@pve:~# lsusb4 R( G5 K$ n6 {* I
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    ' I+ Y! @) U; N0 x4 ?" W; W
  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% w$ M  c0 a; H. s4 y' w
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/0033 u- x' M% M* t! k
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定0 q7 o' y1 r: d- q) d- M3 d' Q) G3 Z
" z% V0 G/ _: c5 X: o; N
启动LXC安装 CUPS 软件及打印机驱动
5 Z% ]( Y- g; i0 h0 }# s
  1. apt install cups hplip -y9 ]# S9 k' b- Q3 [0 {% S' ~# @
  2. systemctl enable cups
    2 L, w( m2 M( y4 {' m
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件
! m( N3 l+ N0 p$ P0 l
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改: B  r7 N+ r3 [* w! `- H5 F( c- R
7 P8 U# [$ S2 I9 e
  1. # Restrict access to the server...: W. T. b+ t  Z
  2. <Location />: _/ u1 O) z) Y: H5 t
  3.   Order allow,deny
    9 q4 A5 w5 {+ u
  4.   Allow all
    3 o$ j- w% B/ q" t* R5 t! w# R
  5. </Location>  a! r4 x5 {& P5 z, M! K

  6. & X  G' G5 t. ]" ?
  7. # Restrict access to the admin pages...
    6 B$ {5 t9 Y" v) P$ T- C
  8. <Location /admin>
    & O' v+ C* h  R9 Z6 ^' W
  9.   Order allow,deny
    ; ~  u* o; W5 m$ O% }; m/ w
  10.   Allow all" r4 b1 m, e1 m" \" V
  11. </Location>" L% _& F! Z5 s1 Y" y! k

  12. : w* |4 n) p- v: y, Y
  13. # Restrict access to configuration files...
    ) W, i% b1 }; d1 p
  14. <Location /admin/conf>
    3 J* p" l6 a4 F3 V: A7 Q. `1 n
  15.   AuthType Default
    9 @" L' M1 S- @( r7 G/ y; m) |
  16.   Require user @SYSTEM
      z, }) ^5 j$ E( g" _# d) g. s
  17.   Order allow,deny
    - l# K7 z; x( z1 I/ R" R, |
  18.   Allow all7 b) N! \, u4 h2 E- w
  19. </Location>* l& ?1 N# t* L# N: ~: c

  20. # k7 @& x5 s- e" S7 X2 z$ I( d
  21. # Restrict access to log files...
    % y! g9 h" X) |( W2 ^
  22. <Location /admin/log>) t) U' F7 a7 g) T% B) i+ b
  23.   AuthType Default+ s0 ~* H' L, z4 P* F0 {. }# n* I
  24.   Require user @SYSTEM
    " E% p. F, b8 ?" P( z
  25.   Order allow,deny
    0 e7 B- o9 f- K! y
  26.   Allow all
    . k7 v9 R! e9 s0 n
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS7 i# M/ O, {$ L! T5 D
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动. j' h2 Q& ~5 n0 d: A+ u
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压  V" I: H7 [" F: ^! W
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录
6 C. v; @/ }$ Q# U# |( V
  1. cd uld
复制代码
给个权限. q4 L+ u+ t8 ^( l1 m
  1. chmod +x install.sh
复制代码
2 T+ I3 T+ T4 |
安装驱动
! Q& h6 [5 q* C" b0 z6 R9 D* S
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。
5 {* ~! _5 ^" D  \) I6 _+ a2 o* I安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
9 g3 O3 L7 A# f  K添加打印机就行,驱动选择HP Laser MFP 13x Series  [+ p& d* p+ I& ?4 F! p
Ctrl+F搜索“13”容易找到。
  x7 {7 C" M7 y  q设置好后,手机也可以打印了,不用下载APP4 @9 t+ g6 J+ ^- _  Z
电脑添加打印机是(举个例子)
2 n  b) `' m. L) E% L+ E; [
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的# L: ^% T" V- H) Z; E; F/ A) Z5 Q
  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这些轻量级的固件不香么?
: N; M: }- C9 @( d9 I1 n: b, h! k! l: m& M* J
" H1 `1 x8 ]  d
二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 |河北| 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28
. W1 D$ j, l- o) J, v! a装OpenWrt/DD-WRT这些轻量级的固件不香么?

3 M1 x% q. a5 e( T装过。旁路由经常不用,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客服返回顶部