Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I read some posts and parts of FHS to understand which directory I should install packages in. As far as I could understand /opt is for independent packages and /usr/local is for packages that are not maintained by distro repo's.

I want to install a network emulator called "mininet" on my Debian wheezy, so that all users can use it. It has an install.sh script which installs both types of packages: maintained by repo & not maintained by repo. As the first step of the installation I can indicate where I want my base directory to be. Now my question is which directory I should indicate as the base directory? should it be: "/usr/local", "/usr/local/mininet", "/usr/local/bin", "/usr/local/bin/mininet", "/opt" or some other directory?

I would appreciate if you could explain your answer too Thank you.

EDIT: Should I specify the name of the package in the path like we do when installing in /opt (e.g. /usr/local/mininet/) or I shouldn't?

share|improve this question

marked as duplicate by Gilles, polym, jasonwryan, slm Aug 18 '14 at 0:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

If the base directory you mean is used for the --prefix option of ./configure or make, it should be /usr/local.

This way, the software can be installed into the subdirectories of /usr/local, like
/usr/local/bin, /usr/local/lib/mininet and /usr/local/man.

share|improve this answer
I did that once and I realized that the installer has created some files and directories outside of /usr/local/bin in /usr/local/.... is that compliant with FHS? – Sav Aug 17 '14 at 22:13
The FHS explicitly does not specify anything under /usr/local - so it's compliant. To me, it makes sense to use a structure like under /usr. – Volker Siegel Aug 18 '14 at 9:41

for mininet, probably the best way to install it is trying to use the ubuntu packages (option three at http://mininet.org/download/). This will put the package in /usr but more than that will allow you to uninstall the package, even in the case you are doing an upgrade, using apt-get, without leaving litter around your system.

Otherwise I suggest you to install it in /opt/mininet or something. Avoid /usr/local if possible, because all package will mix together and you won't be able to sort which file is related to which package should you want to remove something.

share|improve this answer
If you want the binaries or man pages to be usable by everyone you can manually put symlinks into /usr/local/... pointing to /opt/mininet/.... This would still let you distinguish which files are related to mininet and which ones aren't. – pqnet Aug 17 '14 at 18:21

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