Score:0

Remove unwanted printers

id flag

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)
24601 avatar
in flag
[Stop 20.04 autoadding printers](https://7thzero.com/blog/how-to-stop-ubuntu-20-04-from-auto-adding-network-printers)
id flag
@24601 it does not work, cups-browsed is already disabled I will update my question.
br flag
Some users want nothing whatsoever to do with cups-browsed. Why leave it on the system? `apt purge cups-browsed` and report back.
id flag
@brian_p tried, printers are still here. I think it's something about gnome calling avahi all the time.
cn flag
@AleksandarPavić it is, avahi will add every printer it sees every time. There are q's on au on how to disable avahi ;-)
cn flag
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
Score:1
br flag
  • 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.
id flag
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...
Score:0
id flag

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

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.