1

How do I disable automatic printer discovery in Ubuntu 20.10?

I already tried this suggestion that includes these commands:

sudo systemctl stop cups-browsed
sudo systemctl disable cups-browsed

But executing both of them does not disable the automatic printer discovery in Ubuntu 20.10.

The printer I am using is the Brother MFC-J5330DW and it is connected to the same LAN as my Ubuntu system. When I go into the Settings section and there under Printers, the printer is automatically added with the name "Brother_MFC_J5330DW". If I delete it, then leave the printers section and return again, the printer is back with the same name. And for some reason I cannot use it for printing neither. When I use this printer entry the printer does not react at all. My guess is that Ubuntu has some issues with this automatic printer discovery protocol (i.e. Bonjour or what its name is). For this I manually created a printer entry that works perfectly. The only thing now is that I find myself having two entries for the same printer - one that works and another useless one that does not.

How can I prevent Ubuntu or rather CUPS to automatically add printers without my concent?

Socrates
  • 2,473
  • Do you need your 20.10 machine to broadcast its existence on the local network? If not, consider this other solution from a little further down the page you linked to. –  Feb 08 '21 at 11:54
  • 1
    To answer your question about discovering printers in any situation. There is one way and one way only: apt purge avahi-daemon. To not add printers as local queues: apt purge cups-browsed. – brian_p Feb 08 '21 at 20:28

2 Answers2

0

The only application that discovers printers on the network and sets up permanent print queues for them is cups-browsed. Purging it from the system is the surefire way of preventing this. Why bother stopping and masking it? It's a waste of time when all you want to do is prevent discovery and set up of a printer. But stopping and masking has gained traction without its proponents explaining why it is better than purging cups-browsed.

That's one issue. Now for a second, completely separate one.

The GTK print dialog (used by Gnome) also discovers and displays printers. It does not install print queues. The displayed printers (which are not queues) often do not print. This is a bug in GTK. A user can do nothing about it.

Are you experiencing the first or second issue? That will decide your course of action.

brian_p
  • 836
0

Having the same problem ("second issue" in reference to @brian_p's answer), and after reading this and that, I ran

sudo systemctl stop avahi-daemon.service
sudo systemctl disable avahi-daemon.service
sudo systemctl stop avahi-daemon.socket
sudo systemctl disable avahi-daemon.socket

and the network printer list in qpdfview's print dialog is gone. Phew!

Disclaimer: in the second link it is said that "disabl[ing] all network computer discovery [...] probably isn't a good idea", so YMMV.

L. Levrel
  • 111
  • 1
    But I need avahi to discover network shares, etc. I just want the printers to auto-popup. when there are 20 printers in a network, this can get overwhelming. – nerdoc Nov 15 '23 at 08:07