What is a FHS compliant installation dir for vendor-provided binaries?

Clash Royale CLAN TAG#URR8PPP
A software vendor has to create a Linux filesystem hierarchy standard (FHS) compliant Debian package.
What installation dir has to be used for binaries?
Software placed in /bin or /usr/bin may be overwritten by system upgrades. Is it okay to install binaries in that directories? Or are this directories reserved for the base system distributor?
/usr/local/bin is for software installed by the system administrator.
Everything under /usr/local must not be modified by system upgrades.
A vendor-provided Debian package may become part of the system upgrade procedure if it is downloaded from a package repository and this repository is registered with apt-add-repository. Therefore, I guess: No?
/opt/<vendor>/bin seems to be okay. But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors? And how to integrate this directory in a FHS compliant way to make $PATH work?
debian fhs
add a comment |
A software vendor has to create a Linux filesystem hierarchy standard (FHS) compliant Debian package.
What installation dir has to be used for binaries?
Software placed in /bin or /usr/bin may be overwritten by system upgrades. Is it okay to install binaries in that directories? Or are this directories reserved for the base system distributor?
/usr/local/bin is for software installed by the system administrator.
Everything under /usr/local must not be modified by system upgrades.
A vendor-provided Debian package may become part of the system upgrade procedure if it is downloaded from a package repository and this repository is registered with apt-add-repository. Therefore, I guess: No?
/opt/<vendor>/bin seems to be okay. But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors? And how to integrate this directory in a FHS compliant way to make $PATH work?
debian fhs
add a comment |
A software vendor has to create a Linux filesystem hierarchy standard (FHS) compliant Debian package.
What installation dir has to be used for binaries?
Software placed in /bin or /usr/bin may be overwritten by system upgrades. Is it okay to install binaries in that directories? Or are this directories reserved for the base system distributor?
/usr/local/bin is for software installed by the system administrator.
Everything under /usr/local must not be modified by system upgrades.
A vendor-provided Debian package may become part of the system upgrade procedure if it is downloaded from a package repository and this repository is registered with apt-add-repository. Therefore, I guess: No?
/opt/<vendor>/bin seems to be okay. But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors? And how to integrate this directory in a FHS compliant way to make $PATH work?
debian fhs
A software vendor has to create a Linux filesystem hierarchy standard (FHS) compliant Debian package.
What installation dir has to be used for binaries?
Software placed in /bin or /usr/bin may be overwritten by system upgrades. Is it okay to install binaries in that directories? Or are this directories reserved for the base system distributor?
/usr/local/bin is for software installed by the system administrator.
Everything under /usr/local must not be modified by system upgrades.
A vendor-provided Debian package may become part of the system upgrade procedure if it is downloaded from a package repository and this repository is registered with apt-add-repository. Therefore, I guess: No?
/opt/<vendor>/bin seems to be okay. But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors? And how to integrate this directory in a FHS compliant way to make $PATH work?
debian fhs
debian fhs
asked Mar 1 at 9:47
G. FiedlerG. Fiedler
1113
1113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Let's consult how Debian outlines /opt:
/opt/ Add-on application software packages Pre-compiled, non ".deb"
binary distribution (tar'ed..) goes here.
/opt/bin/ : Same as for top-level hierarchy
/opt/include/ : Same as
for top-level hierarchy
/opt/lib/ : Same as for top-level hierarchy
/opt/sbin/ : Same as for top-level hierarchy
/opt/share/ : Same as for
top-level hierarchy
In practice, I've seen applications that do install .deb packages there as well. Ideally, /bin and /usr/bin should be reserved, and especially /bin because it is defined as
Essential command executable (binaries) for all users (e.g., cat, ls, cp)
(especially files required to boot or rescue the system)
In practice, it's common to see debian packages from 3rd parties installing to /usr/bin on Debian-based systems, probably because /usr/bin is often part of the PATH variable,so it can be easily launched via command-line. You've mentioned:"Software placed in /bin or /usr/bin may be overwritten by system upgrades". Upgrades target removal of specific files in /usr/bin, so yes it may be overwritten but not unless some .deb package specified removal of yours explicitly (as for example I've encountered with an applet package that removed older version of a dock that I use ). Upgrades can be dangerous if your software depends on specific binary version to be present in /usr/bin.
Another common thing I've seen is symlinking: entry in /usr/bin is a symlink to another location. This might be a viable option for integrating the binary into $PATH as you mentioned in the question. Additionally, this goes along with what Debian's packaging manual regarding FHS states:
4.4. /usr/bin : Most user commands
4.4.1. Purpose
This is the primary directory of executable commands on the
system.
4.4.2. Requirements
There must be no subdirectories in /usr/bin.
So, if you have application that expects subdirectories ( such as Python module with submodule directories ), best practice is to probably place the application elsewhere (in case of Python, that's /usr/lib/python*/dist-packages directory) along with subdirectories, and make a symlink to /usr/bin/my_binary
Another $PATH integration I've seen being done by some vendors is to edit user's $PATH variable and append that to ~/.bashrc. (Yes, this is a poor practice, and I don't encourage it - merely stating the fact that's what I've seen being done).
"But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors?" The mentioned Debian documentation doesn't say anything about registering the directory, so the answer is it doesn't have to, but if you do want to avoid a conflict, you could follow the schema /opt/vendor/package-v-1.2/bin - that is specify package and release version, maybe a year as well.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503725%2fwhat-is-a-fhs-compliant-installation-dir-for-vendor-provided-binaries%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Let's consult how Debian outlines /opt:
/opt/ Add-on application software packages Pre-compiled, non ".deb"
binary distribution (tar'ed..) goes here.
/opt/bin/ : Same as for top-level hierarchy
/opt/include/ : Same as
for top-level hierarchy
/opt/lib/ : Same as for top-level hierarchy
/opt/sbin/ : Same as for top-level hierarchy
/opt/share/ : Same as for
top-level hierarchy
In practice, I've seen applications that do install .deb packages there as well. Ideally, /bin and /usr/bin should be reserved, and especially /bin because it is defined as
Essential command executable (binaries) for all users (e.g., cat, ls, cp)
(especially files required to boot or rescue the system)
In practice, it's common to see debian packages from 3rd parties installing to /usr/bin on Debian-based systems, probably because /usr/bin is often part of the PATH variable,so it can be easily launched via command-line. You've mentioned:"Software placed in /bin or /usr/bin may be overwritten by system upgrades". Upgrades target removal of specific files in /usr/bin, so yes it may be overwritten but not unless some .deb package specified removal of yours explicitly (as for example I've encountered with an applet package that removed older version of a dock that I use ). Upgrades can be dangerous if your software depends on specific binary version to be present in /usr/bin.
Another common thing I've seen is symlinking: entry in /usr/bin is a symlink to another location. This might be a viable option for integrating the binary into $PATH as you mentioned in the question. Additionally, this goes along with what Debian's packaging manual regarding FHS states:
4.4. /usr/bin : Most user commands
4.4.1. Purpose
This is the primary directory of executable commands on the
system.
4.4.2. Requirements
There must be no subdirectories in /usr/bin.
So, if you have application that expects subdirectories ( such as Python module with submodule directories ), best practice is to probably place the application elsewhere (in case of Python, that's /usr/lib/python*/dist-packages directory) along with subdirectories, and make a symlink to /usr/bin/my_binary
Another $PATH integration I've seen being done by some vendors is to edit user's $PATH variable and append that to ~/.bashrc. (Yes, this is a poor practice, and I don't encourage it - merely stating the fact that's what I've seen being done).
"But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors?" The mentioned Debian documentation doesn't say anything about registering the directory, so the answer is it doesn't have to, but if you do want to avoid a conflict, you could follow the schema /opt/vendor/package-v-1.2/bin - that is specify package and release version, maybe a year as well.
add a comment |
Let's consult how Debian outlines /opt:
/opt/ Add-on application software packages Pre-compiled, non ".deb"
binary distribution (tar'ed..) goes here.
/opt/bin/ : Same as for top-level hierarchy
/opt/include/ : Same as
for top-level hierarchy
/opt/lib/ : Same as for top-level hierarchy
/opt/sbin/ : Same as for top-level hierarchy
/opt/share/ : Same as for
top-level hierarchy
In practice, I've seen applications that do install .deb packages there as well. Ideally, /bin and /usr/bin should be reserved, and especially /bin because it is defined as
Essential command executable (binaries) for all users (e.g., cat, ls, cp)
(especially files required to boot or rescue the system)
In practice, it's common to see debian packages from 3rd parties installing to /usr/bin on Debian-based systems, probably because /usr/bin is often part of the PATH variable,so it can be easily launched via command-line. You've mentioned:"Software placed in /bin or /usr/bin may be overwritten by system upgrades". Upgrades target removal of specific files in /usr/bin, so yes it may be overwritten but not unless some .deb package specified removal of yours explicitly (as for example I've encountered with an applet package that removed older version of a dock that I use ). Upgrades can be dangerous if your software depends on specific binary version to be present in /usr/bin.
Another common thing I've seen is symlinking: entry in /usr/bin is a symlink to another location. This might be a viable option for integrating the binary into $PATH as you mentioned in the question. Additionally, this goes along with what Debian's packaging manual regarding FHS states:
4.4. /usr/bin : Most user commands
4.4.1. Purpose
This is the primary directory of executable commands on the
system.
4.4.2. Requirements
There must be no subdirectories in /usr/bin.
So, if you have application that expects subdirectories ( such as Python module with submodule directories ), best practice is to probably place the application elsewhere (in case of Python, that's /usr/lib/python*/dist-packages directory) along with subdirectories, and make a symlink to /usr/bin/my_binary
Another $PATH integration I've seen being done by some vendors is to edit user's $PATH variable and append that to ~/.bashrc. (Yes, this is a poor practice, and I don't encourage it - merely stating the fact that's what I've seen being done).
"But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors?" The mentioned Debian documentation doesn't say anything about registering the directory, so the answer is it doesn't have to, but if you do want to avoid a conflict, you could follow the schema /opt/vendor/package-v-1.2/bin - that is specify package and release version, maybe a year as well.
add a comment |
Let's consult how Debian outlines /opt:
/opt/ Add-on application software packages Pre-compiled, non ".deb"
binary distribution (tar'ed..) goes here.
/opt/bin/ : Same as for top-level hierarchy
/opt/include/ : Same as
for top-level hierarchy
/opt/lib/ : Same as for top-level hierarchy
/opt/sbin/ : Same as for top-level hierarchy
/opt/share/ : Same as for
top-level hierarchy
In practice, I've seen applications that do install .deb packages there as well. Ideally, /bin and /usr/bin should be reserved, and especially /bin because it is defined as
Essential command executable (binaries) for all users (e.g., cat, ls, cp)
(especially files required to boot or rescue the system)
In practice, it's common to see debian packages from 3rd parties installing to /usr/bin on Debian-based systems, probably because /usr/bin is often part of the PATH variable,so it can be easily launched via command-line. You've mentioned:"Software placed in /bin or /usr/bin may be overwritten by system upgrades". Upgrades target removal of specific files in /usr/bin, so yes it may be overwritten but not unless some .deb package specified removal of yours explicitly (as for example I've encountered with an applet package that removed older version of a dock that I use ). Upgrades can be dangerous if your software depends on specific binary version to be present in /usr/bin.
Another common thing I've seen is symlinking: entry in /usr/bin is a symlink to another location. This might be a viable option for integrating the binary into $PATH as you mentioned in the question. Additionally, this goes along with what Debian's packaging manual regarding FHS states:
4.4. /usr/bin : Most user commands
4.4.1. Purpose
This is the primary directory of executable commands on the
system.
4.4.2. Requirements
There must be no subdirectories in /usr/bin.
So, if you have application that expects subdirectories ( such as Python module with submodule directories ), best practice is to probably place the application elsewhere (in case of Python, that's /usr/lib/python*/dist-packages directory) along with subdirectories, and make a symlink to /usr/bin/my_binary
Another $PATH integration I've seen being done by some vendors is to edit user's $PATH variable and append that to ~/.bashrc. (Yes, this is a poor practice, and I don't encourage it - merely stating the fact that's what I've seen being done).
"But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors?" The mentioned Debian documentation doesn't say anything about registering the directory, so the answer is it doesn't have to, but if you do want to avoid a conflict, you could follow the schema /opt/vendor/package-v-1.2/bin - that is specify package and release version, maybe a year as well.
Let's consult how Debian outlines /opt:
/opt/ Add-on application software packages Pre-compiled, non ".deb"
binary distribution (tar'ed..) goes here.
/opt/bin/ : Same as for top-level hierarchy
/opt/include/ : Same as
for top-level hierarchy
/opt/lib/ : Same as for top-level hierarchy
/opt/sbin/ : Same as for top-level hierarchy
/opt/share/ : Same as for
top-level hierarchy
In practice, I've seen applications that do install .deb packages there as well. Ideally, /bin and /usr/bin should be reserved, and especially /bin because it is defined as
Essential command executable (binaries) for all users (e.g., cat, ls, cp)
(especially files required to boot or rescue the system)
In practice, it's common to see debian packages from 3rd parties installing to /usr/bin on Debian-based systems, probably because /usr/bin is often part of the PATH variable,so it can be easily launched via command-line. You've mentioned:"Software placed in /bin or /usr/bin may be overwritten by system upgrades". Upgrades target removal of specific files in /usr/bin, so yes it may be overwritten but not unless some .deb package specified removal of yours explicitly (as for example I've encountered with an applet package that removed older version of a dock that I use ). Upgrades can be dangerous if your software depends on specific binary version to be present in /usr/bin.
Another common thing I've seen is symlinking: entry in /usr/bin is a symlink to another location. This might be a viable option for integrating the binary into $PATH as you mentioned in the question. Additionally, this goes along with what Debian's packaging manual regarding FHS states:
4.4. /usr/bin : Most user commands
4.4.1. Purpose
This is the primary directory of executable commands on the
system.
4.4.2. Requirements
There must be no subdirectories in /usr/bin.
So, if you have application that expects subdirectories ( such as Python module with submodule directories ), best practice is to probably place the application elsewhere (in case of Python, that's /usr/lib/python*/dist-packages directory) along with subdirectories, and make a symlink to /usr/bin/my_binary
Another $PATH integration I've seen being done by some vendors is to edit user's $PATH variable and append that to ~/.bashrc. (Yes, this is a poor practice, and I don't encourage it - merely stating the fact that's what I've seen being done).
"But doesn't this directory have to be registered somewhere to avoid conflicts with other vendors?" The mentioned Debian documentation doesn't say anything about registering the directory, so the answer is it doesn't have to, but if you do want to avoid a conflict, you could follow the schema /opt/vendor/package-v-1.2/bin - that is specify package and release version, maybe a year as well.
edited Mar 1 at 10:40
answered Mar 1 at 10:29
Sergiy KolodyazhnyySergiy Kolodyazhnyy
10.7k42764
10.7k42764
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503725%2fwhat-is-a-fhs-compliant-installation-dir-for-vendor-provided-binaries%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown