找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 929|回复: 6

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

[复制链接]
发表于 2025-4-19 22:27:36 | 显示全部楼层 |阅读模式
理论上群辉应该也可以。
+ [+ p. I* V' S
3 O% T$ Y, O, J/ M! C我是用PVE的LXC模版。- Z# y1 X5 @  j
PVE版本号:8.4! [1 J' ~5 b& v# R6 G
LXC是Ubuntu 18.04.3 LTS
9 M& m% ?0 n2 P因为用这个LXC安装了adguard home,所以也在这个上安装了CUPS,不用折腾换源了。' T; K2 V3 O2 v5 B9 r
每种版本对应的不一样,这个版本的换源是
# s9 v% X( w6 \  n2 ]% I6 J! f打开文档,注释掉原来的源, L# W" h/ G4 i  L( x! p# q* b
  1. sudo vi /etc/apt/sources.list
复制代码
阿里云源:
% g- b1 R; A1 A! X! w5 S5 u4 O
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse( Q$ w) ]$ {: K
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse$ c/ |5 L. k; P) T- W( @( r5 |
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse% ~% X- `& i. H8 Z
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    ( I; D; G: x) B8 D. i  v# p
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse/ U9 Z6 v) d8 U. o  g& H/ r
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    # X- s5 B4 N9 |, D
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    % F8 J9 x! o0 k, \7 ~5 N. B& i7 J
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse& v4 f4 y6 [' O% c6 b
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    7 B$ r* f3 }- x! I, a
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
清华源:
# ?% X2 v8 l$ M! Q! a, m3 s
  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    2 v' u. Z% B- t
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    0 L, N5 i& C; _) P% B
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse4 A- v4 w) f0 j2 k+ g3 ]
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse/ t% @  k3 V( ?; x+ u! F
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    $ D/ H! [% L" \
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse6 m+ ?$ a' l2 }" O/ ~2 G
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse* S# p' N" M1 Q7 n+ v. a; w
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse8 ?3 J0 E2 b# |+ v# _
  9. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    6 C) p. _2 k+ `/ T' m+ w8 _
  10. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse& W3 F8 ~" W) Z( X4 u) d  L/ `  F: [& G2 o
复制代码
中科大源:
0 Q% ]% @7 u6 D! b
  1. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    5 `( w  x% {' T7 g7 `- K+ Q& Q  H
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse3 h' n6 |$ L- r+ W
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    1 {6 w$ I0 R+ d- \' H: M: P5 o
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" k2 e- ?1 Y' N( v
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    ' v  w; U; N. U" B0 o" D; U7 ?
  6. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    3 B+ k! h2 t; y
  7. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    & t+ W( l' G8 A7 }4 C8 ]
  8. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse! }: r' h/ j0 L3 B  b# j' t$ J+ m
  9. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse; Y4 |( g. t2 l: `7 G
  10. deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
复制代码
163源:" j) i) S- Y& x3 `+ Y  K
  1. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse8 l) o2 y) f- ?
  2. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    ! L! S+ @( M% o: B& ^
  3. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    ! q  m. i( f& [8 P5 x$ w8 O
  4. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    * j5 d1 W' V# `, d' x
  5. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse6 ]3 c5 S" D6 m
  6. deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    / {2 ?5 j& m7 T6 y! @. v5 \
  7. deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    9 M: t+ m7 ]$ q1 l
  8. deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    4 U, I- x* Y. a$ z/ ]! l1 e( D
  9. deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    - [, z" \' ~- C1 |; n" L
  10. deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
更改完成之后执行以下命令
$ R8 x+ B" b7 a5 y
  1. sudo apt-get update
复制代码
完成后先关闭LXC,打印机插上USB
- I5 j0 _, T* j3 H! UPVE的Shell输入lsusb查询打印机
! _0 W) n  [. X) g
  1. root@pve:~# lsusb
    4 j3 S% f7 a. |% x5 X4 K4 h: ~9 ~2 {
  2. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub* w* w; C' s+ |% E5 t. Y  ^3 U) J
  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
    0 m' Q  x3 s  K% n' {: [
  4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
复制代码
Bus 001 Device 003就是打印机,路径是dev/bus/usb/001/003
4 |9 R0 S6 W4 |* K; F9 G. m: }+ pPVE的LXC - 资源 - 添加 - 设备直通 - 粘贴路径 - 确定8 V3 k. o8 e4 ^( a

' J1 X7 M, g8 I8 V  f启动LXC安装 CUPS 软件及打印机驱动
6 n0 n; A7 G& {9 I* B
  1. apt install cups hplip -y
    ' f0 m  l& r' [/ q# J9 y9 R, r, p
  2. systemctl enable cups
      x* D; W/ {* z$ O) o1 y
  3. systemctl start cups
复制代码
编辑 CUPS 的配置文件2 W! N! {; U( _4 W2 y; r2 Q( m
  1. nano /etc/cups/cupsd.conf
复制代码
其他项按照以下修改
) P) c, O6 q- s$ i' i
5 O. A! R, L4 {/ x3 n; g- p- ^* `
  1. # Restrict access to the server...7 M5 I7 [, i+ `
  2. <Location />
    * M& E  Z! y2 X0 Z
  3.   Order allow,deny
    7 L; ^3 ^- k# X& I: m, N# o- [5 R
  4.   Allow all  _, y" t" J. ]2 @, `* `
  5. </Location>" h# m* c3 @$ z$ x) T6 U

  6. 8 [6 L) Z  D2 f( c( M  k
  7. # Restrict access to the admin pages...# Z) c$ o7 h, S8 |0 @+ a) e
  8. <Location /admin>
    8 `+ Z, ~- |' G( ]& ~' S
  9.   Order allow,deny
    & I! X! ^/ q/ Y
  10.   Allow all
    - j2 N1 [+ \. }" n7 g6 u' P7 y5 [
  11. </Location># t0 E% j9 p) Y: X$ m
  12. 1 e# a5 S1 m. C* e
  13. # Restrict access to configuration files...
      ~; I; z9 B7 J' i6 Z. v6 E4 [( `
  14. <Location /admin/conf>
    " a! g6 U/ _; K* a+ `( i: y$ ^
  15.   AuthType Default
    * t  b. I7 l- t, U# H. w1 ], L( S* N
  16.   Require user @SYSTEM
    $ c7 Y/ i1 T' {
  17.   Order allow,deny
    ; Y/ t8 ^  c* Z& z2 M. h
  18.   Allow all
    $ J2 ]6 R7 b' Q/ w( B
  19. </Location>. r- g/ }/ b+ ^- ~. I: b. }& n; T
  20. ; ]  K) e, M9 [& V
  21. # Restrict access to log files...
    , b: c+ ]$ F7 E
  22. <Location /admin/log># @, R, p8 P: i2 h
  23.   AuthType Default
    0 O' _9 S; @9 y9 Z! i6 b5 k
  24.   Require user @SYSTEM5 n3 k9 [: Z! m1 z$ Z; l% x
  25.   Order allow,deny
    ' X: W5 l$ R. G6 p3 h" }
  26.   Allow all. |/ ^- P; H, L8 m# D
  27. </Location>
复制代码
修改好后Ctrl+S 保存、Ctrl+X 退出,重启CUPS
6 {/ ]$ g( G: s4 X; o+ C
  1. sudo service cups restart
复制代码
下载惠普HP136a LINUX驱动
% I( R; w. _: B# V
  1. wget https://ftp.hp.com/pub/softlib/software13/printers/MFP170/uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
解压
4 \" ^7 R) k$ M# L
  1. tar -zxvf uld-hp_V1.00.39.12_00.15.tar.gz
复制代码
进入安装目录
4 Z# o/ z- ]% E
  1. cd uld
复制代码
给个权限9 Z' e/ v* F$ T' j* q
  1. chmod +x install.sh
复制代码
! U- \% I! J5 f2 {
安装驱动' i' q- H' X6 ?! m! B% C' Z* N
  1. ./install.sh
复制代码
一大段说明,慢慢按回车键,Y同意就行。" t7 {0 ]* _  B4 |, }. j6 K
安装好后打开CUPS界面,账号root,密码就是lxc设置的密码
$ j9 k) Z$ \! R7 t/ _添加打印机就行,驱动选择HP Laser MFP 13x Series
" N' |! R+ K* a* B0 H) x' z1 O; mCtrl+F搜索“13”容易找到。7 ~* x1 n0 k" T9 h3 Q2 p
设置好后,手机也可以打印了,不用下载APP$ t5 K# h# b& P& p
电脑添加打印机是(举个例子)
! r& C0 H/ B1 X) {" b# ]
  1. https://192.168.10.3:631/printers/HP_Laser_MFP_131_133_135-138
复制代码
手机添加打印机是(举个例子),不带http的
2 N' ~# G' R, H# ~% P/ [
  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这些轻量级的固件不香么?
5 g; P" i) Y! p( }# u* Z8 J, T5 b
0 v7 s' w! B  f, q; s- C
) J4 H1 b! L2 a2 a3 s! G! z" f二○二五年四月二十日
 楼主| 发表于 2025-4-20 16:56:43 | 显示全部楼层
邪恶海盗 发表于 2025-4-20 11:28( n" F& j' n& s3 t' |2 h# y
装OpenWrt/DD-WRT这些轻量级的固件不香么?
5 ]5 b6 t" v; @8 A! u% B
装过。旁路由经常不用,adguard是常开机,所以和adguard装一块了。
发表于 2025-5-27 09:55:48 | 显示全部楼层
不错,谢谢分享
发表于 2025-5-27 20:33:09 | 显示全部楼层
不错,谢谢分享
 楼主| 发表于 2025-5-29 06:50:45 | 显示全部楼层
2025/5/29更新,还是有些不好用,海鲜市场入手了小白盒,好几天没和媳妇吵架了。。。。
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

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

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

GMT+8, 2026-1-29 14:17 , Processed in 0.030024 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

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