Skip to content

Instantly share code, notes, and snippets.

@brandoningli
Created October 12, 2021 01:55
Show Gist options
  • Save brandoningli/ae7719b366bec8153abdc4e9f81276a8 to your computer and use it in GitHub Desktop.
Save brandoningli/ae7719b366bec8153abdc4e9f81276a8 to your computer and use it in GitHub Desktop.
Disable GNOME printer discovery (avahi and cups-browsed)
#!/bin/bash
# NOTE: This may also disable file server auto discovery
# https://www.linuxupdate.co.uk/2021/05/19/how-to-stop-gnome-auto-printer-discovery-on-fedora-ubuntu-mint/
# Tested on Pop!_OS 20.04 LTS (Ubuntu based)
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
sed -i 's/use-ipv4=yes/use-ipv4=no/g' /etc/avahi/avahi-daemon.conf
sed -i 's/use-ipv6=yes/use-ipv6=no/g' /etc/avahi/avahi-daemon.conf
systemctl restart avahi-daemon
sed -i 's/# BrowseProtocols none/BrowseProtocols none/g' /etc/cups/cups-browsed.conf
systemctl disable cups-browsed
systemctl stop cups-browsed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment