Author Topic: Where do foomatic/gutenprint store their driver data?  (Read 248 times)

Offline Howard

  • Hero Member
  • *****
  • Posts: 728
Where do foomatic/gutenprint store their driver data?
« on: March 04, 2013, 01:27:53 PM »
Further to my problem with the NX200 drivers and landscape printing.

I remember in the distant past (about 5 years ago) hacking into a data file in, I think foomatic, to adjust wrong printer page size limits and wondered if I can do the same to make the NX200 print in landscape correctly.  But I cannot find the data files anyone know where they are?
How does one become a hero?  By asking a lot of dumb questions apparently! I have three computers of various ages, the most powerful is a Dell Netbook 10v; each has 2 or 3 versions of PCLOS of various vintages.  Location, St John's, Newfoundland.

Offline footstep11

  • Full Member
  • ***
  • Posts: 105
  • Linux User: #63879
Re: Where do foomatic/gutenprint store their driver data?
« Reply #1 on: March 05, 2013, 02:50:44 AM »
But I cannot find the data files anyone know where they are?

In general, if you want to find files in your system you have two choices. The first is to use the locate command. For example,

locate foomatic

will list all the files that have foomatic in their path.

Another possibility is to find any installed package with foomatic in the name:

rpm -qa|grep foomatic

Explanation: rpm -qa will query (the q flag) the package database for all (the a flag) the installed packages. Then you apply a filter (a pipe, in technical terms) to the output by means of the grep command, that will show only the lines containing the word foomatic. On my system I obtain

Quote
rpm -qa|grep foomatic
gutenprint-foomatic-5.2.9-1pclos2013
foomatic-filters-4.0.9-1pclos2011
foomatic-db-4.0-2.20110221.1pclos2011
foomatic-db-engine-4.0.8-1pclos2011

To list which files corresponds to a package you then use

rpm -ql packagename

where again the q flag means query and the l flag means list. For example:

Quote
rpm -ql foomatic-db-4.0-2.20110221.1pclos2011
/usr/share/cups/model/foomatic-db-ppds
/usr/share/doc/foomatic-db-4.0
/usr/share/doc/foomatic-db-4.0/COPYING
/usr/share/doc/foomatic-db-4.0/README
/usr/share/doc/foomatic-db-4.0/USAGE
/usr/share/foomatic/db
/usr/share/foomatic/db/oldprinterids
/usr/share/foomatic/db/source
/usr/share/foomatic/db/source/PPD
/usr/share/foomatic/db/source/PPD/Brother
/usr/share/foomatic/db/source/PPD/Brother/BR2600CN_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR2700_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR3070_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR3450CN_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR4050_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR4070_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5050_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5070DN_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5070_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5150_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5170_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5240_2_GPL.ppd.gz
.......

Anyway, the answer to your question is: the files are in /usr/share/foomatic/db/source ;)

Ciao, Mauro
Desktop with Intel Core2 Duo CPU E8500 @ 3.16GHz
nVidia GeForce 9400 GT,  4GB DDR2 RAM
‎82801I (ICH9 Family) HD Audio Controller
82566DC-2 Gigabit Network Connection
PCLinuxOS 32Bit, FullMonty (KDE)
Linux kernel 3.2.18-pclos2.pae.bfs

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1924
  • Certified Windows Hater
Re: Where do foomatic/gutenprint store their driver data?
« Reply #2 on: March 05, 2013, 03:44:06 AM »
But I cannot find the data files anyone know where they are?

In general, if you want to find files in your system you have two choices. The first is to use the locate command. For example,

locate foomatic

will list all the files that have foomatic in their path.

Another possibility is to find any installed package with foomatic in the name:

rpm -qa|grep foomatic

Explanation: rpm -qa will query (the q flag) the package database for all (the a flag) the installed packages. Then you apply a filter (a pipe, in technical terms) to the output by means of the grep command, that will show only the lines containing the word foomatic. On my system I obtain

Quote
rpm -qa|grep foomatic
gutenprint-foomatic-5.2.9-1pclos2013
foomatic-filters-4.0.9-1pclos2011
foomatic-db-4.0-2.20110221.1pclos2011
foomatic-db-engine-4.0.8-1pclos2011

To list which files corresponds to a package you then use

rpm -ql packagename

where again the q flag means query and the l flag means list. For example:

Quote
rpm -ql foomatic-db-4.0-2.20110221.1pclos2011
/usr/share/cups/model/foomatic-db-ppds
/usr/share/doc/foomatic-db-4.0
/usr/share/doc/foomatic-db-4.0/COPYING
/usr/share/doc/foomatic-db-4.0/README
/usr/share/doc/foomatic-db-4.0/USAGE
/usr/share/foomatic/db
/usr/share/foomatic/db/oldprinterids
/usr/share/foomatic/db/source
/usr/share/foomatic/db/source/PPD
/usr/share/foomatic/db/source/PPD/Brother
/usr/share/foomatic/db/source/PPD/Brother/BR2600CN_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR2700_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR3070_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR3450CN_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR4050_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR4070_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5050_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5070DN_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5070_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5150_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5170_2_GPL.ppd.gz
/usr/share/foomatic/db/source/PPD/Brother/BR5240_2_GPL.ppd.gz
.......

Anyway, the answer to your question is: the files are in /usr/share/foomatic/db/source ;)

Ciao, Mauro

Not related to the topic but I wanted to give you my thumbs up!
A very nice answer from a new forum member. :)
Complete and straight to the point...
« Last Edit: March 05, 2013, 03:51:12 AM by agmg »
For the whole world, you are someone.
For someone, you are the whole world.

Offline Howard

  • Hero Member
  • *****
  • Posts: 728
Re: Where do foomatic/gutenprint store their driver data?
« Reply #3 on: March 05, 2013, 05:47:59 AM »
Thanks Mauro,

I should have been more specific.  I did know how to use locate although I hadn't realised that it was now available to LXDE users - previously I had to go to root (su) to locate anything. 

One thing you didn't mention was the updatedb command, which updates the file where the list of files is stored, otherwise you may miss any recently added files.  And updatedb is still only available to root (go figure!)

In the past I was able to find a file which listed all the data like page width, left margin, etc, etc, for each setting of each printer and was able to edit that to correct an error.  I've searched all the epson related files in ..../source/driver/ and not been able to find this file again.

I'm a neophite with grep, all I've been able to do is to search an individual file for NX200 (my printer) and not find it!.  What I'd like to be able to do is to search all files in a folder for NX200 in them (not just the files names, the contents.).  Is there a way to do that?
How does one become a hero?  By asking a lot of dumb questions apparently! I have three computers of various ages, the most powerful is a Dell Netbook 10v; each has 2 or 3 versions of PCLOS of various vintages.  Location, St John's, Newfoundland.

Offline footstep11

  • Full Member
  • ***
  • Posts: 105
  • Linux User: #63879
Re: Where do foomatic/gutenprint store their driver data?
« Reply #4 on: March 06, 2013, 02:20:07 AM »
Thanks Mauro,

You are welcome!

In the past I was able to find a file which listed all the data like page width, left margin, etc, etc, for each setting of each printer and was able to edit that to correct an error.  I've searched all the epson related files in ..../source/driver/ and not been able to find this file again.

I'm a neophite with grep, all I've been able to do is to search an individual file for NX200 (my printer) and not find it!.  What I'd like to be able to do is to search all files in a folder for NX200 in them (not just the files names, the contents.).  Is there a way to do that?

The problem is that the files in ..../source/driver/  are compressed (gzipped) files, so the grep command does not work (at least as is).  The grep syntax is very simple:

Quote
grep string file(s)

So, if you want to find the string NX200 in the files in the .../source/driver folder you chdir in that folder (command cd .../source/driver) and then issue the command

Quote
grep NX200 *

Unfortunately, in this way you miss the files containing nx200... so the trick is to use the -i (insensitive) flag, so all occurences of NX200, nx200, Nx200,... will be found:

Quote
grep -i nx200 *

So, returning to your problem, because the files are of the form ...ppd.gz then grep will not work. The solution should be to uncompress them (with gunzip), perform the search with grep, and then compress them back (with gzip)  (there is a way to do this in one line command, but this is above your pay grade... ;))

But maybe I found a solution. Looking on my system I found that the definition files (ppd files) of the installed printers are in /etc/cups/ppd  Try to give a look there, and if you find a file named as your printer queue, that should be the one to edit.

Even better, did you give a try to the lpoptions command (help via man lpoptions)? This is a command that does what you are looking for, without all the fuss of knowing where the files are...

Hope this helps.

Ciao, Mauro
Desktop with Intel Core2 Duo CPU E8500 @ 3.16GHz
nVidia GeForce 9400 GT,  4GB DDR2 RAM
‎82801I (ICH9 Family) HD Audio Controller
82566DC-2 Gigabit Network Connection
PCLinuxOS 32Bit, FullMonty (KDE)
Linux kernel 3.2.18-pclos2.pae.bfs

Offline footstep11

  • Full Member
  • ***
  • Posts: 105
  • Linux User: #63879
Re: Where do foomatic/gutenprint store their driver data?
« Reply #5 on: March 06, 2013, 02:23:25 AM »
Yes, this tool should help (it doesn't use grep, but is very handy!).    :)


Well, if you look at the script, it does uses grep (actually, this is the command line I was referring to in my previous answer ;))

Ciao, Mauro
Desktop with Intel Core2 Duo CPU E8500 @ 3.16GHz
nVidia GeForce 9400 GT,  4GB DDR2 RAM
‎82801I (ICH9 Family) HD Audio Controller
82566DC-2 Gigabit Network Connection
PCLinuxOS 32Bit, FullMonty (KDE)
Linux kernel 3.2.18-pclos2.pae.bfs