0

When I go to printers on localhost or cups, I only see two printers that I want to use...

When I go to settings printers or print dialog from like Libre Office I see bunch of network printers that I don't want to use...

Deleting them from Settings-Printers, does nothing, they show up again...

enter image description here

Ubuntu 20.04

Answer given here, does not help https://askubuntu.com/a/497769/513874

Also cups browsed is disabled

#systemctl status cups-browsed
● cups-browsed.service - Make remote CUPS printers available locally
     Loaded: loaded (/lib/systemd/system/cups-browsed.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
Tom Newton
  • 105
  • 7
Aleksandar Pavić
  • 846
  • 13
  • 17
  • [Stop 20.04 autoadding printers](https://7thzero.com/blog/how-to-stop-ubuntu-20-04-from-auto-adding-network-printers) – graham Dec 23 '22 at 13:11
  • @24601 it does not work, cups-browsed is already disabled I will update my question. – Aleksandar Pavić Dec 23 '22 at 14:48
  • Some users want nothing whatsoever to do with cups-browsed. Why leave it on the system? `apt purge cups-browsed` and report back. – brian_p Dec 23 '22 at 20:35
  • @brian_p tried, printers are still here. I think it's something about gnome calling avahi all the time. – Aleksandar Pavić Dec 26 '22 at 09:55
  • @AleksandarPavić it is, avahi will add every printer it sees every time. There are q's on au on how to disable avahi ;-) – Rinzwind Dec 26 '22 at 10:59
  • https://askubuntu.com/questions/1314634/how-do-i-disable-automatic-printer-discovery-in-ubuntu-20-10 or https://askubuntu.com/questions/205937/how-can-i-disable-avahi-daemon or https://askubuntu.com/questions/761292/how-to-disable-avahi-daemon-in-ubuntu-16-04-lts or https://askubuntu.com/questions/345132/should-i-disable-avahi-daemon – Rinzwind Dec 26 '22 at 11:00

2 Answers2

1
  • CUPS detects every printer on the network using avahi-daemon. List what it sees with lpstat -l -e.
  • Entrues marked permanent are print queues set up either manually or automatically with cups-browsed. Localhost displays only permanent entries.
  • The remaining entries are not print queues. They are simply printers enumerated by CUPS from what avahi-daemon tells it.
  • Some apps on 20.04 (more on 21.04) can communicate with CUPS to enumerate the non-permanent printers. LibreOffice is one such app.
  • Only when an enumerated entry is printed to is a print queue formed. The queue lasts for a minute and then disappears. It is a temporary queue.
  • Therefore, lpstat -l -e shows potential (temporary) and permanent queue entries.
  • Temporary queues are an important feature of the present and future driverless printing framework.
  • Disabling or purging avahi-daemon removes the driverless printing benefits and all queues have to be permanent and set up with vendor drivers. Users doing this will run into big trouble in upcoming Ubuntus.
  • There isn't any way as yet for apps or CUPS to filter enumerated printers.
brian_p
  • 746
  • 1
  • 4
  • 5
  • Thanks @brian_p so it seems like Ubuntu needs new feature to filter those entries (mark some not to be shown). Or something like that... In my case I see like 25 printers... – Aleksandar Pavić Dec 27 '22 at 07:06
0

So the only way that I was able to disable unwanted printers is to block them via firewall.

Following steps are required:

  1. List all printers via lpstat -l -e

  2. Find their IP's via avahi-browse --all -t -r

  3. Enable and install ufw

  4. Disable individual printers by ufw deny to printer_ip

Aleksandar Pavić
  • 846
  • 13
  • 17