[texhax] where to put .sty files?

Ian.Collier at comlab.ox.ac.uk Ian.Collier at comlab.ox.ac.uk
Tue Sep 28 11:58:58 CEST 2004

Pierre MacKay opined:
>Not so very incidentally, one of the most important things you can do to
>keep the distribution file tree clean (and to keep a lot of bad things
>from happening)
>is to change fstab so that /usr is mounted read-only.  You have to put a link
>to /usr/local in there first, but from then on, when risky packages try to alter
>your /usr partition, you get a solid warning that they need to be altered before
>installing.  Occasional things HAVE to be added to /usr. but very few.
When you install an RPM package it will usually go in /usr.  You may not
do that very often, but keeping up with OS updates can sometimes involve
daily installations.  Of course I'm talking here from the point of view
of Red Hat or Fedora, but it probably applies to other distributions

>/usr/local will have to be on a distinct partition, of course.
>My /usr/local --> /opt/local (which indicates a long past experience
>with Solaris)

Conversely, I have /opt -> /usr/local/opt. :-)

[someone whose attribution has been lost wrote:]
>| cd /usr/share/texmf	# or wherever your $TEXMFMAIN is
>| find . -type d | cpio -pdv /usr/local/share/texmf

>| <*.sty> files can then go in /usr/local/share/texmf/tex/latex/<package>

>Copying the entire TEXMFMAIN to /usr/local seems extreme.  That is what
>TEXMFCNF is for, and most particularly what SELFAUTOLOC, etc. is for.

As has been already pointed out, this copies only the directory
structure and not the files themselves (although in my opinion this
will still give a rather large number of directories that you'll have
no need for).

>The one lot of things you do have to copy out of /usr is the binaries
>you actually use, which must be in /usr/local/bin (links won't work).

I think you're thinking here of where it will find the texmf.cnf file,
but if you need to edit it then it's probably better just to bite the
bullet and edit the copy in /usr/share/texmf rather than install a whole
new collection of TeX binaries.  I don't like editing things in /usr,
but it is at least listed as a config file in the RPM package (I suspect
I'd have made it a symlink to somewhere in /etc if I'd been packaging
it).  If you really don't want to do that then you can set the TEXMFCNF
environment variable.  Usually, though, texmf.cnf doesn't need editing
as it's already configured to look in /usr/local/share/texmf as well as

[from a later post]
>Moreover, I would maintain that the benefits of making /usr a read-only
>partition are too numerous to list.  It should be one of the first steps
>in securing against invasion from crackers.

It takes about 10 seconds to remount a /usr partition read-write, so I
seriously doubt it will be any hindrance to a cracker.  (Of course, in
saying that I've defeated my argument in the first paragraph!)
---- Ian Collier : imc at comlab.ox.ac.uk : WWW page below
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml

More information about the texhax mailing list