Where to install programs in Arch Linux?
Solution 1:
There are a few places for apps to be installed in Arch Linux:
- for apps that follow the Filesystem Hierarchy Standard and are installed by system package manager (in case of Arch
pacman
),/usr/
tree is used. Most commonly used parts by applications are:-
/usr/bin/
- this is where the app's binaries (executables) go -
/usr/share/
- this is where the app's other resources go (usually of the immutable kind)
-
- for apps that follow FHS principles, but are installed per hand (commonly compiled via
make
and installed viamake install
),/usr/local/
is the right place. The hierarchy here mimics the one from/usr/
and its intention is to separate manually installed stuff from the automatic, repository stuff. Please note that if you intend to keep the local packages up-to-date and install a lot of them, using AUR, an AUR helper and learning how to maintain packages is probably a better way than overcrowding/usr/local/
. - for apps that have more monolithic folder structure (e.g. Matlab),
/opt/
is the way to go. One usually just puts the folders there, e.g./opt/MonolithicApp/
,/opt/Matlab/
, etc. - since games tend to have the monolithic folder structure quite often,
/usr/local/games/
is a designated place to put these, aside from/opt/
. Which one should be used is left to user's discretion.
In order to keep things convenient, some additions to $PATH
are necessary in case of programs installed in /opt/
. If there is a single binary, I tend to just create a symlink in /usr/local/bin/
.
If there are more than one/two binaries, it mandates a PATH="$PATH:/opt/MonolithicApp/bin/"
addition somewhere in the shell config files.
Sources:
- https://wiki.archlinux.org/index.php/arch_filesystem_hierarchy
- http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard