The Wandering Output
Ubuntu utilizes the Common UNIX Printing System (CUPS) to manage printers. While generally reliable, Ubuntu attempts to be helpful when dealing with environments that have multiple printers (like a large office). If you print to a specific network printer, or if Ubuntu detects a new printer appearing on the local network (perhaps via mDNS/Bonjour), it may sometimes automatically change your system’s default printer to that newly discovered or recently used device. This means the next time you hastily click ‘Print’ in a document, your job might be sent to the color laser printer down the hall instead of the cheap inkjet sitting right next to your desk.
Locking the CUPS Default
To ensure your print jobs always go exactly where you expect and stop Ubuntu from automatically changing the default printer, you must modify the CUPS configuration to ignore dynamic network discoveries for default routing.
Open a terminal window (Ctrl+Alt+T). You need to edit the main CUPS configuration file as the administrator. Type sudo nano /etc/cups/cups-browsed.conf and press Enter (provide your password). This file controls how Ubuntu handles network printers. Scroll down through the file (or use Ctrl+W to search) to find a line that begins with CreateIPPPrinterQueues. By default, it is likely set to “All” or “Apple”. Change this line to read exactly: CreateIPPPrinterQueues LocalOnly. Next, find the line (or add it if it’s missing) that says UseCUPSGeneratedPPDs Yes and ensure it is active (no ‘#’ at the start). Press Ctrl+O to save, Enter, and Ctrl+X to exit. Finally, restart the browsing service by typing sudo systemctl restart cups-browsed. You can now safely set your preferred default printer in the standard Ubuntu Settings > Printers menu, and it will not change automatically.