15

I am trying to suppress network printers showing up under Settings/Devices/Printers on my Ubuntu 17.10 (Gnome) desktop. It's my desktop in my office and all the printers in this building appear under Settings/Devices/Printers.

I have edited /etc/cups/cups-browsed.conf as:

BrowseRemoteProtocols none
BrowseLocalProtocols none
BrowseProtocols none

and restarted the service.

$ sudo service cups-browsed restart  

But if I go to settings/Devices/Printers, I still see all the network printers. Same even if I log out and then log in, or restart the system. But it is not that the modification to the cups-browsed.conf file is reset on reboot.

If I manually remove the printers from the Settings/Devices/Printers list (by clicking the gear button next to the "No Active Jobs" and Remove Printer), they are removed but come back on my next visit to the Printers tab. I think it is not intended that the "remove" operation is effective only while I stay inside the tab.

If I stop the cups-browsed as:

$ sudo service cups-browsed stop

or

$ sudo systemctl disable cups-browsed

Settings crashes and on re-opening the Settings/Devices/Printers tab, all the printers are again there.

For your information, there is only one printer visible in http://localhost:631/printers/ or in some of the printing dialogs. However, for example, the printing dialog in Chrome would show me tens of network printers.

How can I stop the system searching for network printers everytime I open Settings/Devices/Printers, or a printing dialog in Chrome?

David Foerster
  • 36,264
  • 56
  • 94
  • 147

2 Answers2

8

This is the mega Q&A here in Ask Ubuntu for what you want to do: How do I disable automatic remote printer installation?. Indeed you've already completed many of the steps listed in many of the answers.

There is one answer though with another step to take. With your favourite editor and sudo powers, edit /etc/avahi/avahi-daemon.conf and insert below the [server] section this line:

enable-dbus=no

then restart the avahi-daemon service:

sudo service avahi-daemon stop
sudo service avahi-deamon start

Stop/Start is preferable in some instances as documented in Unix & Linux.

What has changed

The cupsd server is no longer used. So changing the "Browse" settings in the cups server won't work.

PS Please read the entire answer linked above for more information and the comments on 5 second delay posted below it.

PPS you have the exact same printer I have, Brother DCP-7065DN :)

  • 1
    What are the side-effects? Doesn't this disable avahi completely? – mniess Feb 22 '18 at 12:10
  • @mniess No it doesn't disable avahi completely. The link explains why in more detail. – WinEunuuchs2Unix Feb 22 '18 at 12:11
  • Where does it explain that. I only see people asking the same question over there. – mniess Feb 22 '18 at 12:16
  • @mniess scroll down to the answer with 5 up-votes written by John. – WinEunuuchs2Unix Feb 22 '18 at 12:41
  • 1
    I read the whole thing with all answers. There is no explanation whatsoever regarding my question. According to the avahi documentation your proposed option disables avahi dbus functionality completely and not just printer discovery. – mniess Feb 22 '18 at 13:00
  • PPPS: I also have this printer. :-) – mniess Feb 22 '18 at 13:01
  • Wow what a popular printer the three of us have! I'm off to work now. I'll revisit this thread tonight. – WinEunuuchs2Unix Feb 22 '18 at 13:06
  • @mniess There is an argument in Debian between someone quoting the same answer (verbatim) I linked to and someone else taking your side of the argument: https://lists.debian.org/debian-user/2017/09/msg01071.html This is kind of spooky... Anyway people say it works, it's a quick fix and easy to undo. IMO it's worth trying and if unhappy revert the change. – WinEunuuchs2Unix Feb 23 '18 at 00:23
  • The downside is that a few services will have issues like Gajim for example... :-( – ciampix Jan 22 '21 at 06:51
0

The printers are now automatically discovered by the avahi protocol. That's a protocol from the Apple world that is called Bonjour on Apple computers.

While the suggestion of WinEunuuchs2Unix works, it pretty much disables autodiscovery completely (at least all services using dbus).

Another option would be to disable Bonjour in the printer. It will still be networkable, it just won't announce itself over Bonjour.

This is also an open bug.

mniess
  • 10,546