1

I use Garuda linux and HP printer. When I click "print" from a document viewer, it works. When I type lp -d <printer_name> example.pdf, it works.

But lp example.pdf returns lp: Error - No default destination. And sudo lpadmin -d <printer_name> returns lpadmin: The printer or class does not exist.

Why is this the case? The printer's name is recognized when I use it with lp, but not when I try to set it as default. How do I set the default printer so that lp example.pdf just works?

1 Answers1

0

On Ubuntu 22.04.3 I'd somehow corrupted my printing configuration. By trial and error I restored it:

lpstat -e discovered my printer_name.
sudo systemctl start cups-browsed
lpq -P my_printer_name
lpadmin -d still failed, but that didn't matter.
lpq, lpr, and lp resumed working with no -d or -P needed. But I don't know why.

An uglier solution: in ~/.bashrc, alias lp='lp -d my_printer_name'.