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. 选择打印机生产厂商