CUPS printing setup for Arch Linux.
Installation
sudo pacman -S cups cups-pdfEnable Services
sudo systemctl enable --now cups
sudo systemctl enable --now avahi-daemonAvahi enables automatic network printer discovery.
Configuration
Web interface
Access CUPS admin at: http://localhost:631
Add printer via CLI
# List available printers
lpinfo -v
# Add a printer
lpadmin -p PrinterName -E -v "uri" -m "driver.ppd"
# Set default printer
lpoptions -d PrinterNameNetwork printers (auto-discovery)
With Avahi running, network printers should appear automatically. If not:
# Install nss-mdns for .local hostname resolution
sudo pacman -S nss-mdns
# Edit /etc/nsswitch.conf, add mdns_minimal before resolve:
hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dnsPrint to PDF
The cups-pdf package creates a virtual PDF printer:
# Print to PDF (outputs to ~/PDF/)
lp -d cups-pdf document.txtUseful Commands
lpstat -p # List printers
lpstat -t # Full status
lp -d PrinterName file # Print file
cancel <job-id> # Cancel print job
lprm <job-id> # Remove print jobTroubleshooting
# Check CUPS status
systemctl status cups
# View logs
journalctl -u cups -f
# Restart CUPS
sudo systemctl restart cupsResources
- Arch Wiki: https://wiki.archlinux.org/title/CUPS