After installing mesa-12.0.0, I have the library and header files in

~/Downloads/mesa-12.0.0/lib ~/Downloads/mesa-12.0.0/include

Is it better to simply add the path to LD_LIBRARY_PATH or should I put them into more standard paths such as /usr/lib. What is the best way to put organize the package or both are ok ?



You should not put in /usr/lib: don't mix OS stuff with locally installed stuff.

You can put them in /usr/local/, this is a shadow of /. It has /usr/local/lib, /usr/local/bin, /usr/local/include etc. You should also look into stow it will help you manage your local packages (Keep them separate from each other. While putting them all together.)

Or you can keep them in your home directory: stow can, optionally, help here also.

It is up to you, if you install globally (/usr/local/) or in user directory. Both can be shared with others. But by putting in /usr/local, they are automatically shared. And you need admin (root or …) access to install.

  • 1
    Even /usr/local may be out of bounds if you are on a system where the package manager installs software there (as on some BSDs). There's nothing stopping a local administrator from using /opt or some other top-level directory for locally managed software though. – Kusalananda Jan 19 at 13:08
  • 1
    @Kusalananda I did not know that package managers install to there (how rude of them, did they not learn from earlier error?: When /usr became a system directory.). I use /opt to install stuff that is designed to stay self contained: one dir per package. – ctrl-alt-delor Jan 19 at 13:11
  • 1
    Well, FreeBSD and OpenBSD does (NetBSD uses /usr/pkg). And it makes sense. Packages are not part of the base system, so they are classified as "local software" since it's a local administrator that installs them. – Kusalananda Jan 19 at 13:14

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.