0

After reading the FHS, I have concluded on the following table:

+----------------+-------------------+---------------------------------+-----------------------+
|      Part      |  Sofware in /opt  | Installed by package manager/OS |  User local software  |
+----------------+-------------------+---------------------------------+-----------------------+
| executable     | /opt/X/bin/       | /usr/bin/                       | /usr/local/bin/       |
| read only data | /usr/share/X/     | /usr/share/X/                   | /usr/local/share/X/   |
| global rw data | /var/opt/X/       | /var/lib/X/                     | /var/lib/X/           |
| global config   | /etc/opt/X/       | /etc/X/                         | /etc/X/               |
| user data      | ~/X/              | ~/X/                            | ~/X/                  |
| man page       | /opt/X/share/man/ | /usr/share/man/                 | /usr/local/share/man/ |
| source code    | /opt/X/src/X/     | /usr/src/X/                     | /usr/local/src/X      |
+----------------+-------------------+---------------------------------+-----------------------+

Is this table correct for all software to use?

Also, how does a program, when being installed, "know" whether it is placed in /opt or /usr/local/bin, in order to place its files in the correct place?

  • see here: [jlk.fjfi.cvut.cz/arch/manpages/man/file-hierarchy.7]; it points to the latest standard revision and gives you the actual interpretation, since 'systemd' is defacto-standard – mattia.b89 Apr 21 at 8:26
  • @mattia.b89 but it's not even including the word /opt – A.B Apr 21 at 8:32
  • @A.B I think it has been "deprecated" in favour of already existing nodes... as have you already seen, there is a bit of redundancy – mattia.b89 Apr 21 at 8:35
  • @KaiJ too broad for me, but I can already tell, by reading fhs 2.3 in your link, that a software in /opt should not install in /usr/share/X/ (3.13.2 is talking about packages and administrator. its rationale clarifies a bit). Same issue with /usr/local and /etc/X (cf 4.8.2.2) . Also if using a spec, you should tell which one (3.2?), a later one might contradict previous results. – A.B Apr 21 at 8:45

Your Answer

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

Browse other questions tagged or ask your own question.