Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't decipher the deciding factor on where to place "variable program data" for an /opt installed package. On one hand the FHS says to place all variable data that dictates a program's state into /var/lib and that this data should stick around after a reboot. It also says this data is host specific. Now the FHS also says that the /var/opt directory should house opt "variable data". So.. lets just say I have installed a package and I have the option of setting its "working directory (this is how the package names this path)". Where should I put it?

For reference See:

Note that this question naturally extends to /usr/local variable data as well.

share|improve this question
On a related note, see this Fedora wiki item about converting /var/tmp and /var/run to tmpfs. – Phil Hollenback Apr 21 '11 at 3:53
I think this is in reply to my question about backups for /var and not this current question. (Phil Hollenback's reply) – fthinker Apr 21 '11 at 4:27
I was just pointing out there's a lot of confusion about what goes in /var and how it's supposed to work. – Phil Hollenback Apr 21 '11 at 4:52
Ah, I'm sorry. But yes, the whole construction of /var is a bit bewildering. – fthinker Apr 21 '11 at 17:47

If you want to strictly follow the FHS, then /var/opt/<appname> for the data of apps installed in /opt is the right place to go. Stuff installed in /usr/local typically just used /var/lib/<appname>.

Of course, in practice I think there is little difference unless you have some overlap between your opt/local apps and the ones that come packaged with your distro. I tend to just put everything in to /var/lib since that's the first place myself or anyone would look. Most people are not familiar with or not expecting to find things in /var/opt

share|improve this answer
Don't forget that there is a /var/local directory for storing what would be in /var/opt. So imo this question still remains open unless the answer is that it is just a matter of opinion :) – fthinker Apr 21 '11 at 4:24
Well, the FHS is a standard created mostly for use by distributions. As a user you are free to put your data wherever you want. IMO it is mostly a matter of opinion. Personally I've never put data anywhere other than /var/lib for the reasons I've stated above. Unless you're planning to distribute software you expect to be installed on FHS systems, I think it's mostly a non-issue and more of a matter of site policy than anything else. – Kamil Kisiel Apr 21 '11 at 4:56
I dig. Thank you. – fthinker Apr 21 '11 at 17:46

The difference between /var/opt and /var/lib (or similarly between /opt and /lib) is usually whether any particular package comes from the standard OS repository or manually downloaded and installed/compiled by the administrator. Again usually what ends up in opt folders is purchased non-free programs and 3rd party software not installed by the OS package manager. Those programs and software usually have their own way of self-management, e.g. satisfying library dependencies, un-installation, etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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