Should I put application into /usr/local or /usr/local/share?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












21















What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share.



For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be



/usr/local/scala-2.9.1 


or



/usr/local/share/scala-2.9.1


Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs.



Important: I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.










share|improve this question



















  • 6





    I think /opt is more customary in this sort of context.

    – Faheem Mitha
    Sep 13 '11 at 8:56











  • @Faheem Mitha, very good point. Thanks to you I found such explanation "/opt/'provider' directory tree, similar to the way in which Windows will install new software to its own directory tree C:WindowsProgam Files"Program Name" from linuxtopia.org/online_books/linux_beginner_books/… Could you please post your comment as answer, so I would mark it as THE answer? Thank you.

    – greenoldman
    Sep 13 '11 at 10:22












  • @greenoldman: also please realize that keeping all files in a single dir is not the "standard" way to install applications in Unix. /opt is indeed the right answer, but it is not "widely used" by traditional Unix/Linux software. There are great reasons to split your files in multiple dirs, and also to differenciate /usr from /usr/local

    – MestreLion
    May 1 '13 at 4:06











  • For example, keeping all executables from all applications in a single /usr/bin (or /usr/local/bin) allows your $PATH to reach all software without needing to edit it for each software, a concept that does not exist in Windows

    – MestreLion
    May 1 '13 at 4:12















21















What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share.



For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be



/usr/local/scala-2.9.1 


or



/usr/local/share/scala-2.9.1


Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs.



Important: I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.










share|improve this question



















  • 6





    I think /opt is more customary in this sort of context.

    – Faheem Mitha
    Sep 13 '11 at 8:56











  • @Faheem Mitha, very good point. Thanks to you I found such explanation "/opt/'provider' directory tree, similar to the way in which Windows will install new software to its own directory tree C:WindowsProgam Files"Program Name" from linuxtopia.org/online_books/linux_beginner_books/… Could you please post your comment as answer, so I would mark it as THE answer? Thank you.

    – greenoldman
    Sep 13 '11 at 10:22












  • @greenoldman: also please realize that keeping all files in a single dir is not the "standard" way to install applications in Unix. /opt is indeed the right answer, but it is not "widely used" by traditional Unix/Linux software. There are great reasons to split your files in multiple dirs, and also to differenciate /usr from /usr/local

    – MestreLion
    May 1 '13 at 4:06











  • For example, keeping all executables from all applications in a single /usr/bin (or /usr/local/bin) allows your $PATH to reach all software without needing to edit it for each software, a concept that does not exist in Windows

    – MestreLion
    May 1 '13 at 4:12













21












21








21


4






What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share.



For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be



/usr/local/scala-2.9.1 


or



/usr/local/share/scala-2.9.1


Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs.



Important: I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.










share|improve this question
















What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share.



For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be



/usr/local/scala-2.9.1 


or



/usr/local/share/scala-2.9.1


Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs.



Important: I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.







software-installation directory-structure application






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 14 '14 at 21:39









derobert

73.9k8159213




73.9k8159213










asked Sep 13 '11 at 7:35









greenoldmangreenoldman

2,517104259




2,517104259







  • 6





    I think /opt is more customary in this sort of context.

    – Faheem Mitha
    Sep 13 '11 at 8:56











  • @Faheem Mitha, very good point. Thanks to you I found such explanation "/opt/'provider' directory tree, similar to the way in which Windows will install new software to its own directory tree C:WindowsProgam Files"Program Name" from linuxtopia.org/online_books/linux_beginner_books/… Could you please post your comment as answer, so I would mark it as THE answer? Thank you.

    – greenoldman
    Sep 13 '11 at 10:22












  • @greenoldman: also please realize that keeping all files in a single dir is not the "standard" way to install applications in Unix. /opt is indeed the right answer, but it is not "widely used" by traditional Unix/Linux software. There are great reasons to split your files in multiple dirs, and also to differenciate /usr from /usr/local

    – MestreLion
    May 1 '13 at 4:06











  • For example, keeping all executables from all applications in a single /usr/bin (or /usr/local/bin) allows your $PATH to reach all software without needing to edit it for each software, a concept that does not exist in Windows

    – MestreLion
    May 1 '13 at 4:12












  • 6





    I think /opt is more customary in this sort of context.

    – Faheem Mitha
    Sep 13 '11 at 8:56











  • @Faheem Mitha, very good point. Thanks to you I found such explanation "/opt/'provider' directory tree, similar to the way in which Windows will install new software to its own directory tree C:WindowsProgam Files"Program Name" from linuxtopia.org/online_books/linux_beginner_books/… Could you please post your comment as answer, so I would mark it as THE answer? Thank you.

    – greenoldman
    Sep 13 '11 at 10:22












  • @greenoldman: also please realize that keeping all files in a single dir is not the "standard" way to install applications in Unix. /opt is indeed the right answer, but it is not "widely used" by traditional Unix/Linux software. There are great reasons to split your files in multiple dirs, and also to differenciate /usr from /usr/local

    – MestreLion
    May 1 '13 at 4:06











  • For example, keeping all executables from all applications in a single /usr/bin (or /usr/local/bin) allows your $PATH to reach all software without needing to edit it for each software, a concept that does not exist in Windows

    – MestreLion
    May 1 '13 at 4:12







6




6





I think /opt is more customary in this sort of context.

– Faheem Mitha
Sep 13 '11 at 8:56





I think /opt is more customary in this sort of context.

– Faheem Mitha
Sep 13 '11 at 8:56













@Faheem Mitha, very good point. Thanks to you I found such explanation "/opt/'provider' directory tree, similar to the way in which Windows will install new software to its own directory tree C:WindowsProgam Files"Program Name" from linuxtopia.org/online_books/linux_beginner_books/… Could you please post your comment as answer, so I would mark it as THE answer? Thank you.

– greenoldman
Sep 13 '11 at 10:22






@Faheem Mitha, very good point. Thanks to you I found such explanation "/opt/'provider' directory tree, similar to the way in which Windows will install new software to its own directory tree C:WindowsProgam Files"Program Name" from linuxtopia.org/online_books/linux_beginner_books/… Could you please post your comment as answer, so I would mark it as THE answer? Thank you.

– greenoldman
Sep 13 '11 at 10:22














@greenoldman: also please realize that keeping all files in a single dir is not the "standard" way to install applications in Unix. /opt is indeed the right answer, but it is not "widely used" by traditional Unix/Linux software. There are great reasons to split your files in multiple dirs, and also to differenciate /usr from /usr/local

– MestreLion
May 1 '13 at 4:06





@greenoldman: also please realize that keeping all files in a single dir is not the "standard" way to install applications in Unix. /opt is indeed the right answer, but it is not "widely used" by traditional Unix/Linux software. There are great reasons to split your files in multiple dirs, and also to differenciate /usr from /usr/local

– MestreLion
May 1 '13 at 4:06













For example, keeping all executables from all applications in a single /usr/bin (or /usr/local/bin) allows your $PATH to reach all software without needing to edit it for each software, a concept that does not exist in Windows

– MestreLion
May 1 '13 at 4:12





For example, keeping all executables from all applications in a single /usr/bin (or /usr/local/bin) allows your $PATH to reach all software without needing to edit it for each software, a concept that does not exist in Windows

– MestreLion
May 1 '13 at 4:12










4 Answers
4






active

oldest

votes


















19














I think /opt is more standard in this sort of context. The relevant section in the Filesystem Hierarchy Standard is quoted below.




Distributions may install software in /opt, but must not modify or
delete software installed by the local system administrator without
the assent of the local system administrator.



 Rationale The use of /opt for add-on software is a
well-established practice in the UNIX community. The System V
Application Binary Interface [AT&T 1990], based on the System V
Interface Definition (Third Edition), provides for an /opt structure
very similar to the one defined here.



The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a
similar structure for /opt.



Generally, all data required to support a package on a system must be
present within /opt/, including files intended to be copied
into /etc/opt/ and /var/opt/ as well as reserved
directories in /opt.



The minor restrictions on distributions using /opt are necessary
because conflicts are possible between distribution-installed and
locally-installed software, especially in the case of fixed pathnames
found in some binary software.



The structure of the directories below /opt/ is left up to
the packager of the software, though it is recommended that packages
are installed in /opt// and follow a similar
structure to the guidelines for /opt/package. A valid reason for
diverging from this structure is for support packages which may have
files installed in /opt//lib or /opt//bin.







share|improve this answer
































    5














    You should only use /usr/local/share for files which are not specific to a particular architecture / OS version.



    After that it's up to you whether you distribute the files between the existing subdirs of /usr/local or if you create a new dedicated directory in /usr/local (but the latter will not already exist on the executable PATH, the LD_LIBRARY_PATH, nor the MANPATH).



    Have a look at the FHS






    share|improve this answer























    • Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

      – greenoldman
      Sep 13 '11 at 17:38











    • @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

      – MestreLion
      May 1 '13 at 4:09


















    3














    Until /opt became common, the usual place was /usr/local/lib/<package>.






    share|improve this answer


















    • 1





      From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

      – greenoldman
      Sep 13 '11 at 11:07


















    0














    When installing local applications, there are multiple options depending on how you want to access and update. Also should be noted that some methods look more like the system you already have and some are more ad-hoc. I would suggest that the "best" solutions are the ones that make things easier to manage.



    I have split this answer based on the number of packages to make custom installs for. The splitting is based on my own experiences. These experiences weigh the time it takes to manage the packages and the risks of messing up something. I do not mean that I have the knowledge of common standards but mean this as a reference point to look when making the decision.



    For only few packages,I would to put add-on packages in /opt, where they are out of the way of everything else so nothing can mess them up and they can mess something else up. This is the method I use on my NAS. This method however keeps the binaries off your PATH, so you will need to add them manually. This works well if there are only few packages to install, but becomes quite a mess if there are many.



    Updating here is quite easy as you simply overwrite the directory.



    Pros:



    • simple

    • fast to setup

    • no chance at affecting other parts of the system

    • uninstall is as easy as install

    Cons:



    • Becomes rather tedious if the number of packages to install is large

    • Makes PATH look messy

    For more than a few packages, I would recommend using the /usr/local/<your package> and sym-linking the executable from /usr/local/bin or /usr/local/sbin depending on if you need root privileges. This saves you from changing your PATH every time something new is added so the PATH stays clean. This is the method I use on my Arch laptop for all non-pacman packages and AUR packages.



    Updating is done by overwriting the package directory and checking that the symlink is still valid and fixing if it isn't.



    Pros



    • Doesn't make PATH messy

    • Doesn't affect the base system

    • Still very simple to remove all add-ons and return to a clean base system

    Cons:



    • More work to setup

    • Removing only one package has some searching to do

    For many packages. As this isn't the case you are wanting I will keep it brief. I would recommend splitting the package into bin, lib,share, etc. and installing them to /usr/local. This is to keep the structure clean. You can also specify who can write where and more. For example you don't want people other than root modifying the executable.



    Here the updating gets a little more tricky as you need to write to more than a single directory. I would recommend packaging the whole thing and letting the package manager handle the rest.



    The share



    The share directory itself is for architecture independent files as noted in Faheem's link and the architecture dependent files should go to lib, lib32, lib64, etc.






    share|improve this answer

























    • Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

      – Alois Mahdal
      Nov 20 '15 at 14:40











    • Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

      – Alois Mahdal
      Nov 20 '15 at 14:41











    • And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

      – Alois Mahdal
      Nov 20 '15 at 14:43











    • It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

      – Lauri Tšili
      Nov 26 '15 at 16:57











    • And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

      – Lauri Tšili
      Nov 26 '15 at 17:04










    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
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f20600%2fshould-i-put-application-into-usr-local-or-usr-local-share%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    19














    I think /opt is more standard in this sort of context. The relevant section in the Filesystem Hierarchy Standard is quoted below.




    Distributions may install software in /opt, but must not modify or
    delete software installed by the local system administrator without
    the assent of the local system administrator.



     Rationale The use of /opt for add-on software is a
    well-established practice in the UNIX community. The System V
    Application Binary Interface [AT&T 1990], based on the System V
    Interface Definition (Third Edition), provides for an /opt structure
    very similar to the one defined here.



    The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a
    similar structure for /opt.



    Generally, all data required to support a package on a system must be
    present within /opt/, including files intended to be copied
    into /etc/opt/ and /var/opt/ as well as reserved
    directories in /opt.



    The minor restrictions on distributions using /opt are necessary
    because conflicts are possible between distribution-installed and
    locally-installed software, especially in the case of fixed pathnames
    found in some binary software.



    The structure of the directories below /opt/ is left up to
    the packager of the software, though it is recommended that packages
    are installed in /opt// and follow a similar
    structure to the guidelines for /opt/package. A valid reason for
    diverging from this structure is for support packages which may have
    files installed in /opt//lib or /opt//bin.







    share|improve this answer





























      19














      I think /opt is more standard in this sort of context. The relevant section in the Filesystem Hierarchy Standard is quoted below.




      Distributions may install software in /opt, but must not modify or
      delete software installed by the local system administrator without
      the assent of the local system administrator.



       Rationale The use of /opt for add-on software is a
      well-established practice in the UNIX community. The System V
      Application Binary Interface [AT&T 1990], based on the System V
      Interface Definition (Third Edition), provides for an /opt structure
      very similar to the one defined here.



      The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a
      similar structure for /opt.



      Generally, all data required to support a package on a system must be
      present within /opt/, including files intended to be copied
      into /etc/opt/ and /var/opt/ as well as reserved
      directories in /opt.



      The minor restrictions on distributions using /opt are necessary
      because conflicts are possible between distribution-installed and
      locally-installed software, especially in the case of fixed pathnames
      found in some binary software.



      The structure of the directories below /opt/ is left up to
      the packager of the software, though it is recommended that packages
      are installed in /opt// and follow a similar
      structure to the guidelines for /opt/package. A valid reason for
      diverging from this structure is for support packages which may have
      files installed in /opt//lib or /opt//bin.







      share|improve this answer



























        19












        19








        19







        I think /opt is more standard in this sort of context. The relevant section in the Filesystem Hierarchy Standard is quoted below.




        Distributions may install software in /opt, but must not modify or
        delete software installed by the local system administrator without
        the assent of the local system administrator.



         Rationale The use of /opt for add-on software is a
        well-established practice in the UNIX community. The System V
        Application Binary Interface [AT&T 1990], based on the System V
        Interface Definition (Third Edition), provides for an /opt structure
        very similar to the one defined here.



        The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a
        similar structure for /opt.



        Generally, all data required to support a package on a system must be
        present within /opt/, including files intended to be copied
        into /etc/opt/ and /var/opt/ as well as reserved
        directories in /opt.



        The minor restrictions on distributions using /opt are necessary
        because conflicts are possible between distribution-installed and
        locally-installed software, especially in the case of fixed pathnames
        found in some binary software.



        The structure of the directories below /opt/ is left up to
        the packager of the software, though it is recommended that packages
        are installed in /opt// and follow a similar
        structure to the guidelines for /opt/package. A valid reason for
        diverging from this structure is for support packages which may have
        files installed in /opt//lib or /opt//bin.







        share|improve this answer















        I think /opt is more standard in this sort of context. The relevant section in the Filesystem Hierarchy Standard is quoted below.




        Distributions may install software in /opt, but must not modify or
        delete software installed by the local system administrator without
        the assent of the local system administrator.



         Rationale The use of /opt for add-on software is a
        well-established practice in the UNIX community. The System V
        Application Binary Interface [AT&T 1990], based on the System V
        Interface Definition (Third Edition), provides for an /opt structure
        very similar to the one defined here.



        The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a
        similar structure for /opt.



        Generally, all data required to support a package on a system must be
        present within /opt/, including files intended to be copied
        into /etc/opt/ and /var/opt/ as well as reserved
        directories in /opt.



        The minor restrictions on distributions using /opt are necessary
        because conflicts are possible between distribution-installed and
        locally-installed software, especially in the case of fixed pathnames
        found in some binary software.



        The structure of the directories below /opt/ is left up to
        the packager of the software, though it is recommended that packages
        are installed in /opt// and follow a similar
        structure to the guidelines for /opt/package. A valid reason for
        diverging from this structure is for support packages which may have
        files installed in /opt//lib or /opt//bin.








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 28 at 10:05

























        answered Sep 14 '11 at 1:40









        Faheem MithaFaheem Mitha

        23k1881136




        23k1881136























            5














            You should only use /usr/local/share for files which are not specific to a particular architecture / OS version.



            After that it's up to you whether you distribute the files between the existing subdirs of /usr/local or if you create a new dedicated directory in /usr/local (but the latter will not already exist on the executable PATH, the LD_LIBRARY_PATH, nor the MANPATH).



            Have a look at the FHS






            share|improve this answer























            • Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

              – greenoldman
              Sep 13 '11 at 17:38











            • @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

              – MestreLion
              May 1 '13 at 4:09















            5














            You should only use /usr/local/share for files which are not specific to a particular architecture / OS version.



            After that it's up to you whether you distribute the files between the existing subdirs of /usr/local or if you create a new dedicated directory in /usr/local (but the latter will not already exist on the executable PATH, the LD_LIBRARY_PATH, nor the MANPATH).



            Have a look at the FHS






            share|improve this answer























            • Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

              – greenoldman
              Sep 13 '11 at 17:38











            • @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

              – MestreLion
              May 1 '13 at 4:09













            5












            5








            5







            You should only use /usr/local/share for files which are not specific to a particular architecture / OS version.



            After that it's up to you whether you distribute the files between the existing subdirs of /usr/local or if you create a new dedicated directory in /usr/local (but the latter will not already exist on the executable PATH, the LD_LIBRARY_PATH, nor the MANPATH).



            Have a look at the FHS






            share|improve this answer













            You should only use /usr/local/share for files which are not specific to a particular architecture / OS version.



            After that it's up to you whether you distribute the files between the existing subdirs of /usr/local or if you create a new dedicated directory in /usr/local (but the latter will not already exist on the executable PATH, the LD_LIBRARY_PATH, nor the MANPATH).



            Have a look at the FHS







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 13 '11 at 15:11









            symcbeansymcbean

            2,29511221




            2,29511221












            • Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

              – greenoldman
              Sep 13 '11 at 17:38











            • @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

              – MestreLion
              May 1 '13 at 4:09

















            • Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

              – greenoldman
              Sep 13 '11 at 17:38











            • @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

              – MestreLion
              May 1 '13 at 4:09
















            Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

            – greenoldman
            Sep 13 '11 at 17:38





            Thank you. So, if it is an analogy from Windows, it should be /usr/local/SPECIAL_APP and inside there should be its subdirectories, right?

            – greenoldman
            Sep 13 '11 at 17:38













            @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

            – MestreLion
            May 1 '13 at 4:09





            @greenoldman: nope. No analogy will fit because Windows and Linux use different models: In windows, you usually keep all files in a single dir, where in Linux you usually split them over bin, share, lib, etc

            – MestreLion
            May 1 '13 at 4:09











            3














            Until /opt became common, the usual place was /usr/local/lib/<package>.






            share|improve this answer


















            • 1





              From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

              – greenoldman
              Sep 13 '11 at 11:07















            3














            Until /opt became common, the usual place was /usr/local/lib/<package>.






            share|improve this answer


















            • 1





              From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

              – greenoldman
              Sep 13 '11 at 11:07













            3












            3








            3







            Until /opt became common, the usual place was /usr/local/lib/<package>.






            share|improve this answer













            Until /opt became common, the usual place was /usr/local/lib/<package>.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 13 '11 at 10:46









            TeddyTeddy

            1,227912




            1,227912







            • 1





              From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

              – greenoldman
              Sep 13 '11 at 11:07












            • 1





              From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

              – greenoldman
              Sep 13 '11 at 11:07







            1




            1





            From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

            – greenoldman
            Sep 13 '11 at 11:07





            From what I read, /opt is pretty common, only not used widely, but this is not a surpise if you think of the amount of packages available in repositories.

            – greenoldman
            Sep 13 '11 at 11:07











            0














            When installing local applications, there are multiple options depending on how you want to access and update. Also should be noted that some methods look more like the system you already have and some are more ad-hoc. I would suggest that the "best" solutions are the ones that make things easier to manage.



            I have split this answer based on the number of packages to make custom installs for. The splitting is based on my own experiences. These experiences weigh the time it takes to manage the packages and the risks of messing up something. I do not mean that I have the knowledge of common standards but mean this as a reference point to look when making the decision.



            For only few packages,I would to put add-on packages in /opt, where they are out of the way of everything else so nothing can mess them up and they can mess something else up. This is the method I use on my NAS. This method however keeps the binaries off your PATH, so you will need to add them manually. This works well if there are only few packages to install, but becomes quite a mess if there are many.



            Updating here is quite easy as you simply overwrite the directory.



            Pros:



            • simple

            • fast to setup

            • no chance at affecting other parts of the system

            • uninstall is as easy as install

            Cons:



            • Becomes rather tedious if the number of packages to install is large

            • Makes PATH look messy

            For more than a few packages, I would recommend using the /usr/local/<your package> and sym-linking the executable from /usr/local/bin or /usr/local/sbin depending on if you need root privileges. This saves you from changing your PATH every time something new is added so the PATH stays clean. This is the method I use on my Arch laptop for all non-pacman packages and AUR packages.



            Updating is done by overwriting the package directory and checking that the symlink is still valid and fixing if it isn't.



            Pros



            • Doesn't make PATH messy

            • Doesn't affect the base system

            • Still very simple to remove all add-ons and return to a clean base system

            Cons:



            • More work to setup

            • Removing only one package has some searching to do

            For many packages. As this isn't the case you are wanting I will keep it brief. I would recommend splitting the package into bin, lib,share, etc. and installing them to /usr/local. This is to keep the structure clean. You can also specify who can write where and more. For example you don't want people other than root modifying the executable.



            Here the updating gets a little more tricky as you need to write to more than a single directory. I would recommend packaging the whole thing and letting the package manager handle the rest.



            The share



            The share directory itself is for architecture independent files as noted in Faheem's link and the architecture dependent files should go to lib, lib32, lib64, etc.






            share|improve this answer

























            • Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

              – Alois Mahdal
              Nov 20 '15 at 14:40











            • Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

              – Alois Mahdal
              Nov 20 '15 at 14:41











            • And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

              – Alois Mahdal
              Nov 20 '15 at 14:43











            • It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

              – Lauri Tšili
              Nov 26 '15 at 16:57











            • And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

              – Lauri Tšili
              Nov 26 '15 at 17:04















            0














            When installing local applications, there are multiple options depending on how you want to access and update. Also should be noted that some methods look more like the system you already have and some are more ad-hoc. I would suggest that the "best" solutions are the ones that make things easier to manage.



            I have split this answer based on the number of packages to make custom installs for. The splitting is based on my own experiences. These experiences weigh the time it takes to manage the packages and the risks of messing up something. I do not mean that I have the knowledge of common standards but mean this as a reference point to look when making the decision.



            For only few packages,I would to put add-on packages in /opt, where they are out of the way of everything else so nothing can mess them up and they can mess something else up. This is the method I use on my NAS. This method however keeps the binaries off your PATH, so you will need to add them manually. This works well if there are only few packages to install, but becomes quite a mess if there are many.



            Updating here is quite easy as you simply overwrite the directory.



            Pros:



            • simple

            • fast to setup

            • no chance at affecting other parts of the system

            • uninstall is as easy as install

            Cons:



            • Becomes rather tedious if the number of packages to install is large

            • Makes PATH look messy

            For more than a few packages, I would recommend using the /usr/local/<your package> and sym-linking the executable from /usr/local/bin or /usr/local/sbin depending on if you need root privileges. This saves you from changing your PATH every time something new is added so the PATH stays clean. This is the method I use on my Arch laptop for all non-pacman packages and AUR packages.



            Updating is done by overwriting the package directory and checking that the symlink is still valid and fixing if it isn't.



            Pros



            • Doesn't make PATH messy

            • Doesn't affect the base system

            • Still very simple to remove all add-ons and return to a clean base system

            Cons:



            • More work to setup

            • Removing only one package has some searching to do

            For many packages. As this isn't the case you are wanting I will keep it brief. I would recommend splitting the package into bin, lib,share, etc. and installing them to /usr/local. This is to keep the structure clean. You can also specify who can write where and more. For example you don't want people other than root modifying the executable.



            Here the updating gets a little more tricky as you need to write to more than a single directory. I would recommend packaging the whole thing and letting the package manager handle the rest.



            The share



            The share directory itself is for architecture independent files as noted in Faheem's link and the architecture dependent files should go to lib, lib32, lib64, etc.






            share|improve this answer

























            • Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

              – Alois Mahdal
              Nov 20 '15 at 14:40











            • Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

              – Alois Mahdal
              Nov 20 '15 at 14:41











            • And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

              – Alois Mahdal
              Nov 20 '15 at 14:43











            • It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

              – Lauri Tšili
              Nov 26 '15 at 16:57











            • And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

              – Lauri Tšili
              Nov 26 '15 at 17:04













            0












            0








            0







            When installing local applications, there are multiple options depending on how you want to access and update. Also should be noted that some methods look more like the system you already have and some are more ad-hoc. I would suggest that the "best" solutions are the ones that make things easier to manage.



            I have split this answer based on the number of packages to make custom installs for. The splitting is based on my own experiences. These experiences weigh the time it takes to manage the packages and the risks of messing up something. I do not mean that I have the knowledge of common standards but mean this as a reference point to look when making the decision.



            For only few packages,I would to put add-on packages in /opt, where they are out of the way of everything else so nothing can mess them up and they can mess something else up. This is the method I use on my NAS. This method however keeps the binaries off your PATH, so you will need to add them manually. This works well if there are only few packages to install, but becomes quite a mess if there are many.



            Updating here is quite easy as you simply overwrite the directory.



            Pros:



            • simple

            • fast to setup

            • no chance at affecting other parts of the system

            • uninstall is as easy as install

            Cons:



            • Becomes rather tedious if the number of packages to install is large

            • Makes PATH look messy

            For more than a few packages, I would recommend using the /usr/local/<your package> and sym-linking the executable from /usr/local/bin or /usr/local/sbin depending on if you need root privileges. This saves you from changing your PATH every time something new is added so the PATH stays clean. This is the method I use on my Arch laptop for all non-pacman packages and AUR packages.



            Updating is done by overwriting the package directory and checking that the symlink is still valid and fixing if it isn't.



            Pros



            • Doesn't make PATH messy

            • Doesn't affect the base system

            • Still very simple to remove all add-ons and return to a clean base system

            Cons:



            • More work to setup

            • Removing only one package has some searching to do

            For many packages. As this isn't the case you are wanting I will keep it brief. I would recommend splitting the package into bin, lib,share, etc. and installing them to /usr/local. This is to keep the structure clean. You can also specify who can write where and more. For example you don't want people other than root modifying the executable.



            Here the updating gets a little more tricky as you need to write to more than a single directory. I would recommend packaging the whole thing and letting the package manager handle the rest.



            The share



            The share directory itself is for architecture independent files as noted in Faheem's link and the architecture dependent files should go to lib, lib32, lib64, etc.






            share|improve this answer















            When installing local applications, there are multiple options depending on how you want to access and update. Also should be noted that some methods look more like the system you already have and some are more ad-hoc. I would suggest that the "best" solutions are the ones that make things easier to manage.



            I have split this answer based on the number of packages to make custom installs for. The splitting is based on my own experiences. These experiences weigh the time it takes to manage the packages and the risks of messing up something. I do not mean that I have the knowledge of common standards but mean this as a reference point to look when making the decision.



            For only few packages,I would to put add-on packages in /opt, where they are out of the way of everything else so nothing can mess them up and they can mess something else up. This is the method I use on my NAS. This method however keeps the binaries off your PATH, so you will need to add them manually. This works well if there are only few packages to install, but becomes quite a mess if there are many.



            Updating here is quite easy as you simply overwrite the directory.



            Pros:



            • simple

            • fast to setup

            • no chance at affecting other parts of the system

            • uninstall is as easy as install

            Cons:



            • Becomes rather tedious if the number of packages to install is large

            • Makes PATH look messy

            For more than a few packages, I would recommend using the /usr/local/<your package> and sym-linking the executable from /usr/local/bin or /usr/local/sbin depending on if you need root privileges. This saves you from changing your PATH every time something new is added so the PATH stays clean. This is the method I use on my Arch laptop for all non-pacman packages and AUR packages.



            Updating is done by overwriting the package directory and checking that the symlink is still valid and fixing if it isn't.



            Pros



            • Doesn't make PATH messy

            • Doesn't affect the base system

            • Still very simple to remove all add-ons and return to a clean base system

            Cons:



            • More work to setup

            • Removing only one package has some searching to do

            For many packages. As this isn't the case you are wanting I will keep it brief. I would recommend splitting the package into bin, lib,share, etc. and installing them to /usr/local. This is to keep the structure clean. You can also specify who can write where and more. For example you don't want people other than root modifying the executable.



            Here the updating gets a little more tricky as you need to write to more than a single directory. I would recommend packaging the whole thing and letting the package manager handle the rest.



            The share



            The share directory itself is for architecture independent files as noted in Faheem's link and the architecture dependent files should go to lib, lib32, lib64, etc.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 26 '15 at 16:54

























            answered Aug 20 '15 at 7:40









            Lauri TšiliLauri Tšili

            694




            694












            • Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

              – Alois Mahdal
              Nov 20 '15 at 14:40











            • Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

              – Alois Mahdal
              Nov 20 '15 at 14:41











            • And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

              – Alois Mahdal
              Nov 20 '15 at 14:43











            • It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

              – Lauri Tšili
              Nov 26 '15 at 16:57











            • And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

              – Lauri Tšili
              Nov 26 '15 at 17:04

















            • Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

              – Alois Mahdal
              Nov 20 '15 at 14:40











            • Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

              – Alois Mahdal
              Nov 20 '15 at 14:41











            • And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

              – Alois Mahdal
              Nov 20 '15 at 14:43











            • It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

              – Lauri Tšili
              Nov 26 '15 at 16:57











            • And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

              – Lauri Tšili
              Nov 26 '15 at 17:04
















            Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

            – Alois Mahdal
            Nov 20 '15 at 14:40





            Giving advice based on number of packages is not useful; how do I know which group my package belongs to?

            – Alois Mahdal
            Nov 20 '15 at 14:40













            Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

            – Alois Mahdal
            Nov 20 '15 at 14:41





            Also, when you say "it is recommended", reference source or state clearly that it's your recommendation (I'm guessing the latter...?)

            – Alois Mahdal
            Nov 20 '15 at 14:41













            And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

            – Alois Mahdal
            Nov 20 '15 at 14:43





            And by the way, I don't see how in /opt there would be lesser chance of things messing up your app than when it's spread to /usr etc. Messing up other apps is mush more about naming things properly and not having bugs in install scripts.

            – Alois Mahdal
            Nov 20 '15 at 14:43













            It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

            – Lauri Tšili
            Nov 26 '15 at 16:57





            It is definitely about naming that makes things messed up. It is something that I have experienced in the past and that is why I like to keep my "extra" packages away from everything else. I still don't want it to make things look ugly.

            – Lauri Tšili
            Nov 26 '15 at 16:57













            And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

            – Lauri Tšili
            Nov 26 '15 at 17:04





            And yes you are correct about the "it is recommended" as you may see from my answer I have used "I would recommend" everywhere else. I have now fixed my spelling and cleared why I would recommend something. Again it is just my perspective and not meant as a definitive answer.

            – Lauri Tšili
            Nov 26 '15 at 17:04

















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f20600%2fshould-i-put-application-into-usr-local-or-usr-local-share%23new-answer', 'question_page');

            );

            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






            Popular posts from this blog

            Peggy Mitchell

            The Forum (Inglewood, California)

            Palaiologos