190 lines
15 KiB
Plaintext
190 lines
15 KiB
Plaintext
|
|
Episode: 1194
|
||
|
|
Title: HPR1194: Copying a Printer Definition File Between Systems
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1194/hpr1194.mp3
|
||
|
|
Transcribed: 2025-10-17 21:22:25
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
Howdy folks, this is 5150 for Hacker Public Radio.
|
||
|
|
I recently learned where Linux stores the PPD file created when you set up a printer
|
||
|
|
and how to copy it between PCs.
|
||
|
|
I'd like to briefly share that information with you.
|
||
|
|
And you're probably wondering, well 50, why do I need to know that?
|
||
|
|
Because every time I go into Cups to set up a printer, I'm presented with a list
|
||
|
|
of manufacturers and models I can easily select my printer from there every time, why
|
||
|
|
manually copy the file.
|
||
|
|
Well, I can take a three reasons.
|
||
|
|
First, perhaps the normal Cups, which stands for, of course, Common Unified Printing
|
||
|
|
System, doesn't have the perfect definition file for your printer.
|
||
|
|
In rare instances, you might have to download a PPD from the printer's manufacturer or
|
||
|
|
from another source if the manufacturer doesn't support Linux.
|
||
|
|
If so, if you've done that once on another machine, copy the PPD over may be a lot easier
|
||
|
|
than finding it and downloading it again.
|
||
|
|
The second reason might be you can configure Cups and you get to the point where you would
|
||
|
|
select a manufacturer and a model and it's grayed out.
|
||
|
|
This happened to me the first time I tried to configure Cups under Lanaro on my O-Droid
|
||
|
|
X.
|
||
|
|
Now some people may be tired hearing me talk about the O-Droid.
|
||
|
|
I haven't done a HPR on it yet, that's upcoming.
|
||
|
|
But I can tell you now for the sake of this conversation, it's not going to be about
|
||
|
|
the O-Droid, but for all intents and purposes, Lanaro is an arm port of mainline.
|
||
|
|
Unity included.
|
||
|
|
I installed Cups via aptitude and tried to configure printers I would on any Linux system.
|
||
|
|
When I got to the printer selection, the drop down to select a manufacturer was grayed
|
||
|
|
out.
|
||
|
|
As were the field to manually type in a path to the PPD file and make sure I could replicate
|
||
|
|
it, I closed the browser completely and tried again and the same thing happened.
|
||
|
|
This is what prompted me to try to find out where the PPD files are that are generated
|
||
|
|
by Cups are located on one of my already up and running systems and copied over.
|
||
|
|
I never got to see how it would work though because after I had located the PPD file on
|
||
|
|
my Labuntu system, copied it over the network and had everything set up or any install,
|
||
|
|
the next time I ran Cups, this is a couple days later, on my O-Droid X, when I got to
|
||
|
|
the point to select a manufacturer and then a model.
|
||
|
|
That whole list was populated, it looked just like it would have on any other Linux system.
|
||
|
|
So like I said, it had been a couple days, I had done apt-get update and upgrade on that
|
||
|
|
system in between.
|
||
|
|
I can't imagine that somehow Cups was installed and the printer definitions weren't.
|
||
|
|
I'd rather say it was just sort of a glitch, but I couldn't tell you either way, okay,
|
||
|
|
now the third reason that you might want to move a PPD file from one system to the other.
|
||
|
|
I've talked in a previous episode, previously aired, I assume, about my experience as installing
|
||
|
|
Synarch on my little notebook computer and I installed Cups and when I got to the point
|
||
|
|
subredder, there was common, you know, the manufacturer selections were there, but when
|
||
|
|
you got into HP, you pretty much had LaserJet and Desjet and maybe Color LaserJet, etc.
|
||
|
|
But you didn't really have selections for individual models, there was just one for
|
||
|
|
Desjet.
|
||
|
|
So in that case, and I'm still, I still haven't had time to go back and correct the crash
|
||
|
|
on the, or the problem I'm having on the computer with the desktop manager that I mentioned
|
||
|
|
on the previous episode.
|
||
|
|
So once I get that fixed or installed different arcs, whatever side I'm going to do with it,
|
||
|
|
then I will be copying the more specific PPD file over from one of my other computers and
|
||
|
|
trying it out.
|
||
|
|
Okay, copy the PPD.
|
||
|
|
So you go to the computer where you already have the printer setup, of course.
|
||
|
|
And you're looking for dot PPD file and that's, that stands for post script printer definition.
|
||
|
|
And that's just a text file with a bunch of settings in there, I did a cat on mine just
|
||
|
|
to make sure because when I had trouble with the old droid X, I was thinking, well surely
|
||
|
|
there's nothing binary in there that has to be compiled for a specific platform, it
|
||
|
|
turns out no, there, there wasn't.
|
||
|
|
So I couldn't figure out why I would have cups and I wouldn't have up the manufacturer
|
||
|
|
and model list unless it was a binary, but I digress.
|
||
|
|
You need to go into the system where the printer is already installed and look in the folder
|
||
|
|
slash Etsy slash cups slash PPD slash model.
|
||
|
|
Now depending on your distro, it may be just slash Etsy slash cups slash PPD.
|
||
|
|
Next way my old droid X was, there wasn't a slash model folder, I could, I tried creating
|
||
|
|
one and you certainly, I think you put the PPD where you want and I just checked my Fedora
|
||
|
|
laptop that I'm recording on and it only had, it only has slash Etsy slash cups slash
|
||
|
|
PPD.
|
||
|
|
So check for both of those folders and you should have a one or more files of PPD extension
|
||
|
|
and they're, they're going to be named, they're not going to be the, probably the model
|
||
|
|
name of the printer, these are generated by cups.
|
||
|
|
So it's going to have the name when asked you what to call the printer.
|
||
|
|
So when you're in your applications, if it's a deskjet and you call, and you said the
|
||
|
|
name of this printer is going to be deskjet, you're looking for deskjet dot PPD.
|
||
|
|
If you said the name of this printer is going to be Epson, you're looking for Epson dot
|
||
|
|
PPD or, you know, back office dot PPD, if that's what you named your printer or Fred's printer
|
||
|
|
dot PPD, that's, whatever name you gave it, that's what it's going to be, it's not, it's
|
||
|
|
not going to be a, like a driver name that somehow indicates the model, then you want
|
||
|
|
to copy that over to the other system and depends on which way you're working, but you're
|
||
|
|
not going to be caught in, unless you're on the new system as root, so in other words,
|
||
|
|
if you're remoting into your, if you're on the computer, it has the PPD file and you're
|
||
|
|
trying to copy it over to the computer, it doesn't.
|
||
|
|
It's not likely you're going to be remoted into the computer, it doesn't as root, and
|
||
|
|
you're probably not going to, if you're working the other direction and you're on the computer
|
||
|
|
that lacks the PPD file and you're importing it in or you're, you're remoted into the
|
||
|
|
system, it does have it, you're probably still not going to be locally logged in as root
|
||
|
|
when you do the copy, so you're not going to be able to copy the file directly into slash
|
||
|
|
Etsy slash cup slash PPD slash model, just copy it to your home folder, because you may
|
||
|
|
want to do some manipulations on the file anyway.
|
||
|
|
Now from here, we're in the territory I never actually got the test because like I told
|
||
|
|
you, I went into the old droid the second time and printers were all there, everything
|
||
|
|
was fine, but according to the post I found on linuxquestions.org, of course, you remember
|
||
|
|
the PPD file is the product of installing a printer and all those settings that cups
|
||
|
|
extracts the information about your printer from is apparently in a GZIP file and so there's
|
||
|
|
a GZIP that's a library of all printers, at least now I said I'm going by the article
|
||
|
|
I didn't I didn't actually try this or need to try it, but so in a nutshell, cups isn't
|
||
|
|
looking for when it when it creates that list of printers or manufacturers and models,
|
||
|
|
it's not looking in a in a PPD file, it's looking in a GZIP library, so you want to turn
|
||
|
|
your PPD file into a GZIP library, and of course it's only going to have the one printer
|
||
|
|
and the article I read said to do say, and this is before you copy anything, still in your
|
||
|
|
home folder, do GZIP, space-c, space, myprinter.ppd, space, greater than symbols, space, myprinter.ppd.gz.
|
||
|
|
Now the reason we're doing it that way first, of course, supplantmyprinter.ppd in the example
|
||
|
|
with whatever your PPD's name is, and with the dash c is for copy, because I understand it
|
||
|
|
from reading the information on GZIP, reading the man, that if you just say GZIPmyprinter.ppd,
|
||
|
|
you're going to come up with a new, it's going to overwrite that original file, it's just going
|
||
|
|
to zip that file into itself or into the same file name, so you look there, you won't have a
|
||
|
|
second GZIP file, you'll just have myprinter.ppd, except it will be archived, it will be zipped up,
|
||
|
|
so that's why you use the dash c copies, just make another copy, and then you use the redirection,
|
||
|
|
greater than symbol, to direct the output into a new file name, that way you're not overwriting
|
||
|
|
the original myprinter.ppd, and then of course you would have to become root, and copy the GZIP file
|
||
|
|
into Etsy slash Cups, slash pd slash model, okay, the next part just going to be review on Cups,
|
||
|
|
most people have already heard all this, so you open up the address localhost, colon,
|
||
|
|
631 in a browser, so localhost is going to reference back to whatever the IP address of your
|
||
|
|
system is, so you're opening up a webpage on your system on port 631, which is to port Cups runs
|
||
|
|
on, so if you have Cups installed, there's going to be a webpage at your IP address colon 631,
|
||
|
|
I mean if you have a fixed IP address, you know the IP address, you could type in your
|
||
|
|
IP address, you could type in 127.0.0.1, but it's easier just to type in localhost, colon, literally
|
||
|
|
localhost, colon 631, okay, click the administration tab, and for under administration click the add
|
||
|
|
printer button, and if this is your first time using Cups, and you're using this as a primer,
|
||
|
|
and you're familiar with installing a printer on a Macintosh, and this looks very familiar to you,
|
||
|
|
well, there's a reason for that. Cups is an open source project, but it is solely the creation
|
||
|
|
of Apple, okay, now I've got my desk jet hooked up to an Ethernet print server, another word,
|
||
|
|
that instead of having the USB cable plugged into any printer, or any particular system on my
|
||
|
|
network, I have it plugged into a little print server box, which has an IP address. This is not
|
||
|
|
intended to be a Cups primer, so I'm not going to tell you every possible way to connect to your
|
||
|
|
printer, I'm going to tell you how I connect to my printer. So in my case with the Ethernet
|
||
|
|
print server, I select Apple socket, or no, app socket slash HP JetDirect, and click continue,
|
||
|
|
and JetDirect, as you may or may not know, is HP's brand of Ethernet print servers,
|
||
|
|
it's sort of an industry standard. It's one of those things, like if you're working with third
|
||
|
|
party provider for software, for an enterprise, or any kind of business, they kind of expect you to
|
||
|
|
have, if you're running Windows, they expect you to have Windows Pro, and in the same way,
|
||
|
|
if you're trying to set up printers on a network for any application, they kind of expect you to
|
||
|
|
use a lot of times the JetDirect brand specifically, because it's not bad, they work, they probably
|
||
|
|
cost four or five times, the less expensive models you can find on a new egg, and this is not a
|
||
|
|
JetDirect primer, that's why it's in there, just because it says JetDirect doesn't mean it has to
|
||
|
|
be an HP JetDirect brand Ethernet print server. You select that and you click continue. Now again,
|
||
|
|
this is what works on my network, doesn't necessarily mean this is going to be what works on your
|
||
|
|
network. You have to manually type in the address, and the format that works for me,
|
||
|
|
is socket, colon slash slash, then IP address that I've assigned to my print server, it's going to
|
||
|
|
you know, it's only going to work if you give it a fixed address, colon 9100, which is the default
|
||
|
|
port for Ethernet print services, and then click continue, and I say default port, you may have a
|
||
|
|
different experience for your print server, I can't seem to move to move mine off a 9100, of course,
|
||
|
|
if you can log into your print server and select a different address, then or different port address,
|
||
|
|
I'm sorry, so if you have yours on a different port, then of course you would type in whatever
|
||
|
|
port's appropriate for you. On the next page, you fill in the printer name, remember this where
|
||
|
|
we talked about this is where the PPD comes from, or the name for the PPD, and that'll be how it
|
||
|
|
shows up, of course, every time you select that printer, in an application on the system,
|
||
|
|
you really don't have stuff in the other fields, there's printer description and printer
|
||
|
|
locations, so if you're on a big net, you apply more to a big network, I mean, you're home, you know
|
||
|
|
what that printer is, you really don't have to leave a big long-winded explanation for yourself,
|
||
|
|
now of course, yes, an enterprise environment, you may want to say, hey, this is the this is the
|
||
|
|
printer in the regional manager's office, etc, so people know what they're hitting, and you click
|
||
|
|
continue, and if the post on Linux questions was correct, you know, lacking any other source
|
||
|
|
for to find the printer models and manufacturers, Cups would find the GZ file that you created,
|
||
|
|
the GZ file, and show that one manufacturer and model, if it's the case where, you know, you have
|
||
|
|
you have manufacturers and models, but not the specific one, I'm assuming from article I read,
|
||
|
|
it's Cups is going to look in any GZ file, not just the first one, so you'll have all your standard
|
||
|
|
all your standard printers and normally come with Cups, and then you're one that you just created,
|
||
|
|
will appear in that list as well, now probably it might it might be just as well, remember I
|
||
|
|
mentioned that there is a field just to type in the path to the ppd, and I think there's a browse
|
||
|
|
button on there, maybe you just instead of going through this whole GZ app thing, it might be just
|
||
|
|
just as well that you just copy your ppd file from the other computer, and either that ppd or the
|
||
|
|
model folder depending depending on how Cups is set up on your system, and then reference it
|
||
|
|
that way, and then the next in the next screen you would modify it or accept the default printer,
|
||
|
|
say just whenever you set up a printer, two sided pring blah blah blah all that kind of stuff,
|
||
|
|
the other way to go is you might copy your ppd over and then modify your Etsy slash,
|
||
|
|
sorry slash Etsy, of course slash Cups slash printers dot comp, and you could edit that manually,
|
||
|
|
it seems kind of complicated, but probably wouldn't be too hard to figure out how to
|
||
|
|
place a printer in there, okay this Lexus has been a very drawn out discussion on a very simple thing,
|
||
|
|
so thanks for your attention, this is 5150 for hacker public radio, and you can reach me at 5150
|
||
|
|
at LinuxBasement.com, and my web page such as it is is at thebigredswitch.drupalguardance.com,
|
||
|
|
we'll see you folks the next time.
|
||
|
|
You have been listening to Hacker Public Radio at Hacker Public Radio.
|
||
|
|
We are a community podcast network that releases shows every weekday and Monday through Friday.
|
||
|
|
Today's show, like all our shows, was contributed by a HBR listener like yourself.
|
||
|
|
If you ever consider recording a podcast, then visit our website to find out how easy it really is.
|
||
|
|
Hacker Public Radio was founded by the digital dot pound and the infonomicum computer cloud.
|
||
|
|
HBR is funded by the binary revolution at binref.com, all binref projects are proudly sponsored by
|
||
|
|
LUNA pages. From shared hosting to custom private clouds, go to LUNA pages.com for all your hosting
|
||
|
|
needs. Unless otherwise stasis, today's show is released under a creative comments,
|
||
|
|
attribution, share a like, and do those own lives please.
|