6

Ubuntu 17.10 Every time I remove a printer it gets added back automatically. I have 1 Canon ip8720, 1 brother mfc 8820, 2 canon ts 9020, and 1 deskjet 2549. On the computer running Ubuntu 16.04 lts NO Problem. All sorts of problems on Ubuntu 17.10. I hope this is fixed when 18.04 lts is released. Otherwise I will have to test other distros.

It happens when using local 631 in cups as well but only on 17.10

2 Answers2

1

You can remove the printer through the cups interface http://127.0.0.1:631/printers/ by selecting the printer listed there and at the drop-down list "Administration" delete printer. You also can cancel through this interface the printing jobs if you issue any problems.

  • This way won't work. Instead you should go to the printer internal settings via panel or web GUI and in network settings disable mDNS/Avahi. The printer will stop broadcasting itself to the network and once deleted from your PC it won't come back. – useful Jul 09 '22 at 11:06
  • The above comment has the correct idea : the printers connections that are stored locally are updated by cups using the information collected by the avahi daemon about the printers on the local network, but his solution does not always apply. It does not apply when the issue is that the same printer broadcast different connections using different protocols. If there is no need for these other protocols in the network, the solution is not to disable mDNS in the printer, but the other network features that are not needed. If the other features are needed, then I don't think there is a solution. – Dominic108 Oct 18 '22 at 18:10
1

The answer provided by malliaridis is correct when the printer connection is not broadcast by a printer in the network. Otherwise, it gets back anyway, because cups-daemon uses that information to update the printer connections stored locally. If you don't need this printer in your ubuntu desktop or laptop, the solution is to turn it off, disconnect it from the local network or prevent it from broadcasting itself in the network through Bonjour or anyother way used to broadcast a service in mDNS. In the same manner, if your computer is connected to a printer via the usb port as well as to another (or the same) printer via wifi, you will see two printers and if you delete them, they will be added back. This is to be expected. This is not a bug, but a feature.

However, the issue is also often that the same printer broadcast different connections using different protocols over the wifi. In that case, you see different "printers", but they are different wifi connections for the same printers, many of them often not working in your ubuntu device. These other connections might be needed by other devices in the local network. If they are all ubuntu systems, you can turn off in the printer all network features except the one needed by Ubuntu. (In the case of the HP Color Laser Jet M255, I kept the basic network such as ipv4, ipv6, DHCP together with Bonjour with either IPP or IPPS. But I only succeeded with IPP. If I used IPPS, another connection, which did not work, was also broadcast. Actually, it was sufficient to disable IPPS to avoid the printer being advertised twice.)

The avahi-daemon implements mDNS in Ubuntu. You can check the list of ipp printer connections broadcast on mDNS using avahi-browse -t _ipp._tcp for IPP connections, avahi-browse -t _ipps._tcp for IPPS connection and avahi-browse -at for all connections regardless of the type. The -t option makes the request terminates instead of continuing listening. Even if you reduce the number of network features in the printer, it might be broadcast more than once in mNDS, say under ipv4 and ipv6, etc., but the difference might be sufficient for it not to appear more than once in Settings->Printers and other applications.

The file /etc/cups/printers.conf keeps printer connections that are not broadcast so that you can see the configured printers even when they are turned off. For example, if you have connected via usb to a printer, it will be kept there. The command lpstat -p lists the configured printer connections including those in /etc/cups/printers.conf. The cups daemon regularly updates this file using the information that is broadcast by the printers, but, as already explained, it will not remove all stored connections.

If after these modifications other printer connections still come back after you try removing them in http://127.0.0.1:631/printers/ or even with lpadmin -x, you might need to remove them directly from /etc/cups/printers.conf. It would be pointless to edit this file before the broadcast by the printers is taken care of. When you decide to edit it, you must stop the cups daemon service with sudo service cups stop before doing so and restart cups with sudo service cups start after.

Dominic108
  • 1,387