CUPS printing setup for Arch Linux.

Installation

sudo pacman -S cups cups-pdf

Enable Services

sudo systemctl enable --now cups
sudo systemctl enable --now avahi-daemon

Avahi 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 PrinterName

Network 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 dns

The cups-pdf package creates a virtual PDF printer:

# Print to PDF (outputs to ~/PDF/)
lp -d cups-pdf document.txt

Useful 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 job

Troubleshooting

# Check CUPS status
systemctl status cups
 
# View logs
journalctl -u cups -f
 
# Restart CUPS
sudo systemctl restart cups

Resources