找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 616|回复: 6

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

[复制链接]
发表于 2025-4-19 22:27:36 | 显示全部楼层 |阅读模式
理论上群辉应该也可以。, v8 @$ |# `4 B0 X2 F- L

' u+ a1 \; z5 z# e我是用PVE的LXC模版。
2 _8 x' r  D  oPVE版本号:8.4) W9 p# m4 X3 E8 h# ]0 _
LXC是Ubuntu 18.04.3 LTS
: e, G/ ~8 s8 p% a* T$ S4 a: a, M因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。
4 S. X6 D; ?6 ^$ a! Z/ g每种版本对应的不一样,这个版本的换源是
; A8 F2 X* Q' K% l6 H打开文档,注释掉原来的源: X1 J1 ?3 A+ p5 M+ t
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:
; R7 G. e: j: z3 x* {' B
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    : t3 s* _! W  V, Z
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    ! s5 X. D  [" [+ l
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    4 N5 b' A& G  R# b: w6 K3 \
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    ! X% {+ [8 m% e$ Y5 k
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse! c4 B7 U& n/ R; T/ o6 f6 m
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse1 F& s6 L9 r) a% Y( l2 d/ l. {
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    ( u2 t. s8 f$ I: U! @/ i7 k
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    $ R! h* Q5 a1 D" z5 ]% J4 n
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse! m  p; Q! z7 d* e
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:
1 Z4 E( A, [& P$ v
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse1 U+ q2 O3 o4 e4 |% N( e
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    * y# |4 R) Y) {; D  j
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    3 x& J* f* C4 {  G1 Q
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    7 F/ ?+ U1 B$ Z0 v* y8 C
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    * _& y3 }  |  {4 w, c  Q* L+ V
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    ( C+ ~  U+ K9 H7 j& D
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    0 F, j$ U3 O0 I7 K- J1 u8 b4 l
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    2 I+ t( t, ]/ _" d
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
      l( a, \3 U6 [0 Q
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    6 r6 l2 t2 X9 e$ S' b
复制代码
中科大源:
4 B. s) ?6 m5 s6 T* J
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    ! H5 H) s6 C8 r/ w  E
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    ' i% y' Y5 J" w, p: i' F# a
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse9 ?% `9 u  p0 [7 H+ V
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    3 c4 E- {- l2 [1 v; {- J
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse9 P! B7 Q6 O& B8 W6 V0 z7 s
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    ' F7 X4 b( L% k- g. P
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse5 q" o3 v+ E% Y1 I# H
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
      b$ g4 I8 V# G
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    ( w# v: Q3 X, M) l4 q+ \
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:
& q! |7 F' a* ~9 z
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse8 t" A( h2 m* Y3 s2 A2 H& G
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse$ H2 c5 D6 M1 m' M8 \
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    8 u5 Z  s( u1 J
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
      {. j7 q4 d! \; W# c
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse+ c! n# d: [5 z
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse7 V9 F8 d0 |% X, I9 J! A; j
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse# p5 O$ i( ~4 O" i0 u( X
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    : d6 ]6 W+ O2 Q! @& X; F$ s
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    6 ]2 Y2 }9 K' f! d$ G) ^; N
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令4 E# K- c- E( {
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB
" x6 c. w/ F2 L( N1 r" gPVE的Shell输入lsusb查询打印机  s/ k# x' O( ]6 I' c2 p  ?- U
  1. root@pve:~# lsusb
    & q: @/ S) i% Q* w4 X5 f$ y- W
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub# F; y. J! u7 d* C, O
  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
    / I1 l; L% `0 P
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003; [. v# ~9 E9 x% @+ U/ `2 S
PVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定% u" i; s3 I' ]' p, Y

- z; m4 f" D0 P$ O9 v' R  \! D启动LXC安装 CUPS 软件及打印机驱动( Z. I$ @. Z# C: r/ N
  1. apt install cups hplip -y
    2 X8 c% S: t/ W7 K% r
  2. systemctl enable cups
    8 N/ U; O' p! W0 r7 h# ~
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件
. R2 K3 d9 f& N# d) _
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改
# w& L, N/ f4 B4 W0 a  X6 E
) I8 l3 o# g: i+ J6 P* F
  1. # Restrict access to the server...
    - X6 Q) u' U" a- ], c5 E
  2. <Location />& q8 a# S2 Y9 l6 c" X5 m
  3.   Order allow,deny
    : i% O, f" f" Q: i3 a% @- w( N
  4.   Allow all
    + L( g3 ]1 o8 I/ ~
  5. </Location>
    $ C' |* |/ o8 a" R' L5 x" }" ^0 M' X

  6. . m2 e7 F" T5 w% C9 C9 c. \( P
  7. # Restrict access to the admin pages...- s% _/ Z( q. ]3 i
  8. <Location /admin>
    3 ~; y# t0 }* y6 _  x1 e
  9.   Order allow,deny5 V& ~9 J8 u4 C# l% R. b4 w
  10.   Allow all0 z5 a& I7 ^6 `2 N* O# J
  11. </Location>
    ! }- e6 D8 E, G+ s5 N: ?

  12. & ]  r1 ], L& A, O5 A
  13. # Restrict access to configuration files...
      K2 I) s( y' D: I1 d9 s. V
  14. <Location /admin/conf>& z6 `* d7 b" Z" R! N) f0 s
  15.   AuthType Default
    ( I* R5 w' H2 F1 o6 K1 l) U! _! K
  16.   Require user @SYSTEM
    4 B& T' j  P6 W
  17.   Order allow,deny
    0 S6 b6 D% c# {, ]3 y: }
  18.   Allow all3 b2 n7 p! P; g- v% I
  19. </Location>
    7 p/ i# K/ L$ A$ U
  20. 6 M& h6 z( J* v/ l8 u
  21. # Restrict access to log files...
    3 {# @6 e/ |: j+ J8 a
  22. <Location /admin/log>/ y! ?# ]2 b# m( Y: n
  23.   AuthType Default
    $ v1 `7 U! F* a2 @( ~
  24.   Require user @SYSTEM
    4 F7 A0 K; z' o! X: X& A' j4 r& J
  25.   Order allow,deny
    $ [8 w, P- l. o; ]( V5 x
  26.   Allow all
    + d8 S* T) S; u  {& u: k; W* k
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS- ]1 b, J' z4 ^3 i! S7 J
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动) N- p9 ~8 ~) G* O+ n
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压( D' y1 b) s0 k5 K7 j- c
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录
( k& g. R& C! s
  1. cd uld
复制代码
给个权限- V5 X# ]$ m; U- @
  1. chmod +x install.sh
复制代码
4 p/ `/ v* V# }& P
安装驱动
3 b* c9 [( A) z/ c# [8 k
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。0 u  n  k' @% q$ G2 h/ [5 o! }& R
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码, n8 |' ]6 z3 L) Q$ Q
添加打印机就行,驱动选择HP Laser MFP 13x Series- [& j, _& _& ?& I/ G5 n
Ctrl+F搜索“13”容易找到。! ~' H( h& J6 t# c
设置好后,手机也可以打印了,不用下载APP
) D6 |8 U) |* x电脑添加打印机是(举个例子)  x" L* T- |' [* L$ r) G) o3 c/ g
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的& p9 I1 L* I2 B9 Q3 B0 T
  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 k! K5 h& U$ j! u5 E4 D- C
/ ?: I% q6 Y8 n5 s

8 I1 `) i2 j! T0 p二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 | 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28
: e1 x% C3 g9 s2 {3 h; j装OpenWrt/DD-WRT这些轻量级的固件不香么?

# N: V8 A! {) Z3 x6 L0 U6 ?% [装过。旁路由经常不用,adguard是常开机,所以和adguard装一块了。
发表于 2025-5-27 09:55:48 | 显示全部楼层
不错,谢谢分享
发表于 2025-5-27 20:33:09 | 显示全部楼层
不错,谢谢分享
 楼主| 发表于 2025-5-29 06:50:45 | 显示全部楼层
2025/5/29更新,还是有些不好用,海鲜市场入手了小白盒,好几天没和媳妇吵架了。。。。
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-10-31 05:38 , Processed in 0.022753 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

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