Anda di halaman 1dari 2

I just discovered a, possibly optimal, solution to this mess.

There is as service called "cups-


browsed" which apparently is responsible for going out on the network and finding all the printers
it can locate and install them for you (gee - thanks --NOT). Since this is an Upstart job, you can
stop the service with:

sudo service cups-browsed stop


Even better, you can prevent the service from ever starting again by adding a simple text file
to /etc/init that contains the single word manual. The file must be named cups-
browsed.override
So, just start up gedit with

gksudo gedit /etc/init/cups-browsed.override


put manual in the first and only line and save the file.
On the next Reboot, the service will not be re-started. However, you need not reboot if you've
already stopped the service. Once you've placed this file in /etc/init, the service can only be started
manually (if and when you need/want it) using:

sudo service cups-browsed start


-or-
sudo service cups-browsed stop`
I have tested this over one reboot. Printing still works fine and so far I am not getting several
hundred printers installed anymore after the reboot. Just the ones I installed manually show up.

For me, the problem was solved by doing two things:

(1, possibly not needed?) as suggested above, in /etc/cups/cupsd.conf I have:


Browsing Off
BrowseLocalProtocols none
(2) and in /etc/cups/cups-browsed.conf :
BrowseProtocols none
After service cups-browsed restart and service cups restart I don't have any printers
visible except those which I have added myself.

The cups client libraries now also get a list of network printers from Avahi (which implements the
protocol known variously as zeroconf or Bonjour or mdns or dns-sd). In older versions of cups,
this was only done by the cups server.

You can see what is being broadcast on your network with a shell command like avahi-browse -a
| grep Printer
You can disable avahi with sudo service avahi-daemon stop, but that will stop all zeroconf
based setup, not just printers.
As mentioned earlier, this is now done in the client-side cups libraries (ie libcups.so, which
GNOME and KDE apps link against) and not in the cupsd server. So changing the "Browse"
settings in the cups server won't work.
$ ldd /usr/lib/x86_64-linux-gnu/libcups.so.2
...
libavahi-common.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3
...
IE this behaviour (of showing remote printers in the Print dialog box) happens even if you turn off
your local cups server. You can disable it by turning off the avahi service, but that will disable all
zeroconf/mdns related functionality.
However, there is at least a way to turn off most of avahi's functionality (including adding remote
printers into the CUPS clients) while keeping the DNS functionality (eg when looking
up foo.local-style host names):
edit /etc/avahi/avahi-daemon.conf and in the [server] section, add enable-dbus=no then restart
the avahi-daemon service.
To disable it simply open terminal Ctrl+Alt+T and type
sudo cupsctl --no-remote-printers

or to edit the

/etc/cups/cupsd.conf
and set

Browsing Off
This solution was found here
Some newer Ubuntus (15.04 and up) may need this command instead:

sudo cupsctl --no-share-printers


1. Open http://localhost:631/admin/ → Edit Configuration File or
Edit /etc/cups/cupsd.conf
2. Change:
3. # Show shared printers on the local network.
4. Browsing Off
5. BrowseLocalProtocols none

1 Unfortunately, this didn't stop remote printers from being added for me

It's quite simple to make it stop.

1. Remove the unwanted printers. Then:


2. sudo nano /etc/cups/cups-browsed.conf
3. Change this line: BrowseRemoteProtocols dnssd cups (or whaterver is after it) to none so it
reads: BrowseRemoteProtocols none .
4. Then save the file and reboot.
Solved the problem for me.

Anda mungkin juga menyukai