In Raring, everytime I connect to the network, Cups installs all the printers in the network automatically, some more than once.
Furthermore, I connect a USB printer to the laptop every now and then. Even though the printer is configured already, another printer is added to the list.
I wish to disable this feature and allow only manual installation of printers. How do I go about it?
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/Systemd job, you can stop the service with:
For Ubuntu versions 15.04+ (using systemd)
Followed by:
You may still start/stop the service manually if you wish with:
For Ubuntu versions prior to 15.04 (using upstart)
Even better, you can prevent the service from ever starting again by adding a simple text file to
/etc/init
that contains the single wordmanual
. The file must be namedcups-browsed.override
So, just start up gedit with
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:
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.
In
/etc/cups/cups-browsed.conf
, set directive:Afterwards, run
service cups-browsed restart
andservice cups restart
. There should be no printers visible, except those you've added yourself.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.
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, addenable-dbus=no
then restart the avahi-daemon service.I tried all of the above. Modifying Cups did not work in Linux Mint 20, which is based on Ubuntu 20.4. Apparently, Ubuntu and Mint no longer use Cups for Printer discovery, but instead now use Avahi. I think it is a Systemd thing. Setting enable-dbus=no in avahi-daemon.conf somewhat worked, but caused the print menu in LibreOffice to take a long time (maybe 20-30 sec.) to show up, and thus was not a good solution.
The following did work, however, very well:
In that file:
Now, only printers that I added manually show up in the "Printers" control panel (Printers-localhost), the HPLIP Toolbox and LibreOffice.
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.To disable it simply open terminal Ctrl+Alt+T and type
or to edit the
and set
This solution was found here
Some newer Ubuntus (15.04 and up) may need this command instead:
It's quite simple to make it stop.
Remove the unwanted printers. Then:
Change this line:
BrowseRemoteProtocols dnssd cups
(or whaterver is after it) to none so it reads:BrowseRemoteProtocols none
.Then save the file and reboot.
Solved the problem for me.
Found the solution, if you disable bonjour in HP (probably other printers too) the mystery printer detection is an issue of the past.
Try:
Open
http://localhost:631/admin/
→ Edit Configuration File or Edit/etc/cups/cupsd.conf
Change:
Reference: cupsd.conf: BrowseLocalProtocols