Ubuntu – Where to install software and executables for all users

filesysteminstallation

By default some applications install into /usr/local/bin, but if I change users will that user be able to access this application? I read somewhere here (another question) that I should use /opt? But binaries that by default goes into /usr/local/bin? theres no /opt/bin?

Best Answer

Usually you should not have to try to install anything by hand. In almost all cases you will find a .deb package. If there isn't one google for suggestions (like how to install Oracle JDK in Ubuntu). If this is your own software, check out the Ubuntu Packaging Guide for help on how to properly put stuff into Ubuntu.

If you must do it anyway, put the binary in /opt/myapp and link the executable with ln -s /opt/myapp/myappbinary /usr/local/bin/myappbinary. If you want to know more on the topic type man hier in a terminal. The difference between /usr/bin and /usr/local/bin is explained there. In any case both paths are in the $PATH environment variable. That means any binary you put there will be executable by anyone just giving the name of the binary (and not the full path). So using the above example you can run your program with myappbinary instead of having to give the full path /opt/myapp/myappbinary.