How to Properly Delete a Conflicting CUPS Printer Instance When BrowsePoll Causes Duplicate Entries


26 views

When dealing with CUPS configurations using BrowsePoll, you might encounter situations where printers appear with multiple naming variations like hpext and hpext@vm-cups. This typically happens when:

  • The local CUPS server caches old printer instances
  • DNS or hostname resolution creates naming inconsistencies
  • BrowsePoll refreshes don't properly clean up old entries

First, verify all printer instances:

lpstat -v
lpstat -a

To properly delete the conflicting printer (even when web interface fails):

sudo lpadmin -x hpext
sudo lpadmin -x hpext@vm-cups
sudo systemctl restart cups

When standard deletion doesn't work, try these advanced steps:

# Stop CUPS service
sudo systemctl stop cups

# Remove printer configuration files
sudo rm -f /etc/cups/printers.conf*
sudo rm -rf /var/spool/cups/tmp/*

# Clear CUPS cache
sudo rm -f /var/cache/cups/*

# Restart CUPS
sudo systemctl start cups

Add these directives to /etc/cups/cupsd.conf:

BrowsePoll cups.eecs.tufts.edu:631
BrowseRemoteProtocols dnssd
BrowseOrder allow,deny
BrowseAllow from @LOCAL

After making changes, verify with:

lpinfo -v
lpstat -t

The output should only show your intended printer name without @host variations.


When CUPS maintains ghost printer entries like hpext and hpext@vm-cups that conflict with BrowsePoll-discovered printers, standard removal methods often fail. This typically happens when:

  • The printer was previously configured with multiple protocols (IPP, socket, etc.)
  • CUPS database corruption occurs during network printer discovery
  • Permission issues prevent proper deletion through normal channels

When the web interface and lpadmin commands fail, we need to manually clean CUPS' internal databases:

# Stop CUPS first
sudo systemctl stop cups

# Remove printer from printers.conf
sudo sed -i '/^<Printer hpext@vm-cups>/,/^<\/Printer>/d' /etc/cups/printers.conf

# Clean out PPD files
sudo rm -f /etc/cups/ppd/hpext@vm-cups.ppd

# Remove job cache
sudo rm -f /var/spool/cups/*hpext@vm-cups*

# Restart CUPS
sudo systemctl start cups

After cleaning, force CUPS to rediscover the correct printer from your BrowsePoll server:

# First remove all instances
sudo lpadmin -x hpext
sudo lpadmin -x hpext@vm-cups

# Then explicitly add the correct version
sudo lpadmin -p hpext -E -v ipp://cups.eecs.tufts.edu/printers/hpext -m everywhere

When all else fails, reset CUPS' entire configuration while preserving your BrowsePoll settings:

sudo systemctl stop cups
sudo mv /etc/cups/printers.conf /etc/cups/printers.conf.bak
sudo rm /etc/cups/printers.conf.O /etc/cups/printers.conf.prev
sudo systemctl start cups

Confirm successful removal and proper rediscovery with:

lpstat -v | grep -E 'hpext|vm-cups'
cupsctl | grep BrowsePoll

The output should only show the single valid printer entry from your BrowsePoll server.