I would like to clarify the software application and libraries installation philosophy and best practices in Linux. From my understanding from the Filesystem Hierarchy Standard (FHS), new software must be installed in /opt, and that is what the package manager does. But, does the package manager also install application software in /use/local directory or just library software? For example, I installed the Eigen c++ library, which is a header file based library, using:
sudo apt install libeigen3-dev
I found Eigen files in /usr/include. But, from reading CMake documents, when I am developing C++ libraries, I should configure my CMake to install them in /usr/local (This is the default value for CMAKE_INSTALL_PREFIX)? This raises the question, why was Eigen installed in /usr/include instead of /usr/local/include? Are not the directories /usr/bit /usr/include for system applications like the commands ls and cat?
Further, what is the difference between the libraries saved in /usr/local vs /usr/share?
Many thanks in advance for your help. I hope get a clear understanding of the best practices in installing application and library software in Linux.