We have just switched to a centralized print queue. The printer is setup with

lpadmin -p SPScolour -E -D "Sustainable Print Colour" -v lpd://xxx.yyy.com/colour

The IT people are saying my local username must match my central username. Of course the IT people are not that organized and I have a number of "central" usernames. Is there a way to specify the print queue username through an environment variable or some other trick?

I can work around the username constraint by using lp -U mycentralusername -d SPSColour foo.txt. This isn't a complete solution since not all GUIs give you the option of specifying the print command. If I am willing to install a different printer for each user I can do

lpadmin -p SPScolour -E -D "Sustainable Print Colour" -v lpd://mycentralusername@xxx.yyy.com/colour

I have had no luck with setting lpoptions. I have tried

lpoptions -d SPScolour -o username=myusername
lp -d SPSColour foo.txt

which does not print. It looks like lpoptions takes a -U flag, but I cannot figure out how to use it.

lpoptions -U myusername -d SPSColour

gives me an error.

  • Have you tried lpoptions -U myusername -d SPSColour -o username=myusername? I think the -U flag if for lpoptions itself and the option username=myusername is used lated when you call lp. – lgeorget May 8 '13 at 15:55
  • @lgeorget I have tried lpoptions -U myusername -d SPSColour -o username=myusername and I get the same error. I cannot manage to use lpoptions with the -U flag. Further, lp -o username=myusername -d SPSColour foo.txt doesn't work. I am not sure username is really an "options". – StrongBad May 9 '13 at 9:37

If your printer was setup with lpadmin, you should be able to get and set its options with lpoptions. There is a file called ~/.cups/lpoptions for each user (you can create it if it doesn't exist), and another called /etc/cups/lpoptions for system-wide settings. If you're able to change your settings with the lpoptions command, then you can make the settings persistent in those configuration files.

Have a look at man 1 lpoptions and give it a try.

  • Thanks for the hint. lpoptions seems like the right way to go, but I cannot get it to work. I edited the question to include what I have tried. – StrongBad May 8 '13 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.