OMV安装CUPS共享惠普打印机为网络打印机

该文指导如何使用sudonano编辑Debian的sources.list文件,替换为USTC镜像源,然后更新系统并安装Ghostscript、dc等软件。接着,文章说明了如何修改CUPS配置文件以允许所有访问,并重启CUPS服务。最后,介绍了安装hplip驱动并使用CUPS配置管理打印机的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

sudo nano /etc/apt/sources.list

注释掉原来的内容,加入以下国内源:

deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian buster main contrib non-free

deb http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free

deb http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free

deb http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

然后,更apt新系统:

apt-get update
apt-get upgrade


安装相关的软件:

apt-get install ghostscript
apt-get install dc
apt-get install foomatic-db-engine
apt-get install cups


apt-get install foomatic-db-engine更新失败跳过
编辑CUPS的配置文件:

nano /etc/cups/cupsd.conf

首先需要将

Listen localhost:631

改成

Listen 0.0.0.0:631
1
然后,将以下4段加入Allow all:

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>

保存。重启CUPS进程。

service cups restart
 

安装驱动

apt install hplip

使用浏览器访问CUPS服务配置和管理打印机

1. 在浏览器的地址栏输入: localhost:631

2. 则出现CUPS管理页面

3. 选择“Manage Printers”,则进入打印机页面

4. 点击添加打印机

访问这个页面需要本地的有相应权限的用户名和密码,如果你以普通用户使用浏览器,在弹出的对话框里输入正确的用户名(一般默认为 root) 和 密码,则进入添加打印机页面。

5. 在弹出的对话框中输入你想设定的打印机名字(随自己喜欢什么样便于识别的名字),点击:“continue”

6. 选择正确的连接到打印机的端口

因CUPS服务器安装的是本地打印机,一般根据自己的情况选择usb或者并口

7. 选择打印机生产厂商

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hwj277

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值