Linux default printer?

LO 7 is defaulting to the wrong printer. How do I make it use the Linux CUPS default printer?

In /etc/libreoffice/psprint.conf I’m seeing

; DefaultPrinter: marks the default printer
DefaultPrinter=1

But my CUPS Print Settings is this:

If I try and change /etc/libreoffice/psprint.conf to 4 as follows

; DefaultPrinter: marks the default printer
DefaultPrinter=4

It still points to the wrong printer, e.g. Brother… in this case.

Also if I print to the default printer, then save the LO page and close LO, and re-open LO the wrong printer is again selected as the default.

If go to File | Printer Settings..., then select the correct printer, then print a document, then save and close LO, and restart LO, … the printer I set is again gone and the wrong printer is again the default.

I must be doing something wrong but what?

Also I looked at ~/.config/libreoffice/4/user/psprint/* but this appears to be a few years old.

Your UI looks like Gnome or MATE. Which desktop manager have you installed? And which is your distro?
If your printers are managed by CUPS, use your browser (Firefox?) to go to localhost:631/printers and check/configure printers.
Alternatively, you can have a look at /etc/cups/printers.conf.

@ajlittoz, I think I fixed it.

/etc/cups/printers.conf showed the correct default printer:

<DefaultPrinter CP4020>
...

and ~/.cups/lpoptions listed two 'Dest ':

$ cat lpoptions
Dest CP4020
Dest Officejet-J6400-series PageSize=Letter

But I discovered that when I issued a lpoptions -d CP4020 now ~/.cups/lpoptions listed a 'Default ’ which initially fixed LO’s default.

$ cat lpoptions
Default CP4020
Dest Officejet-J6400-series PageSize=Letter

I also tried removing ~/.cups/lpoptions and this also makes LO get the correct default printer.

In the process I found a good description of how CUPS works.

Also testing with $ lp <text-file-name> was a quick way to break the problem in half, but it fooled me because it didn’t look at the ~/.cups/lpoptions file.

My distro is Debian bookworm. Desktop: cinnamon.

Thanks for the help.