opt/ vs /usr/local/opt

Where do you recommend such distribution would be preferred for FreeBSD?

  • /opt/ foo

  • /usr/local/opt foo

  • Either or is just fine


Results are only viewable after voting.
I recently learned that not all BSD distros have a default /opt/ path as Linux does. Notably FreeBSD. Which was news to me because the original BSD distro I was playing with did. Reading the documentation it would appear that FreeBSD recommends /usr/local/. For my purposes, I was using /opt/ foo originally. But for distribution purposes, I can see the logic in using /usr/local/opt foo in the future.

A few keynotes. The distribution has its own libraries (you could technically run tar xjf foo.tar.bz2 on your desktop and it would work there). It also has the option to self-update. Which means whatever path used it would using chmod 757.

Where do you recommend such distribution would be preferred for FreeBSD?

/opt/ foo
/usr/local/opt foo
 
If this is only for your own systems then it really doesn't matter and /opt/ would work just fine.

If this is for a new port you're going to submit then neither works. Although some ports install as /usr/local/${portname} (see sysutils/logstash6 for example) but that's an exception, most ports use /usr/local/bin, /usr/local/lib, etc.

It also has the option to self-update.
For a real port this would be a no-no.
 
If this is only for your own systems then it really doesn't matter and /opt/ would work just fine.

If this is for a new port you're going to submit then neither works. Although some ports install as /usr/local/${portname} (see sysutils/logstash6 for example).

Can you explain further? If by port you mean to inquire will this be using a repo via the package manager, no.
 
I mean a proper submitted port in /usr/ports (all packages in the repositories are built from this).
Not using repo and application will be backward compatible between Linux and BSD... ie... Not looking to make a separate release.
 
Not using repo and application will be backward compatible between Linux and BSD... ie... Not looking to make a separate release.

So it's basically a private self-contained application that you are deploying without using pkg.

It really makes no difference, although I would go for /usr/local/opt to at least maintain some of the fundamental hierarchy of FreeBSD. The "root" directories are for the system, third party stuff should be under /usr/local/.

If you're using /opt on Linux, and it will simplify things to just use the same path, then I don't really see a problem doing that either tbh.
 
So it's basically a private self-contained application that you are deploying without using pkg.
YES. I am sorry if I have not been clear on that. I wrongfully assumed when I said it would not be using the package manager (or repo) that folks would know this is what I meant.
 
Packages are allowed to create arbitrary directories under /usr/local as long as they don't clash with each other, therefore /usr/local/opt is definitely not recommended. Self-updating software usually lives in the user's home directory.
 
Packages are allowed to create arbitrary directories under /usr/local as long as they don't clash with each other, therefore /usr/local/opt is definitely not recommended.
The application will support multi-user involvement. But we also do not want it clashing. Exactly what makes /usr/local/opt foo a bad choice? Originally /opt/ foo was considered since it should be more independent.
 
I wrongfully assumed when I said it would not be using the package manager (or repo) that folks would know this is what I meant.
You wrongfully assumed everything is based on packages ;)

With FreeBSD all third-party software starts with a port. All package repositories for all versions and architectures are built from those ports.
 
You wrongfully assumed everything is based on packages ;)

With FreeBSD all third-party software starts with a port. All package repositories for all versions and architectures are built from those ports.
The distribution will be you download a sh bash file. Run the bash it downloads the tar, it extracts to install path, it creates user shortcuts. DONE.
 
Honestly, that's just weird. The point of multi-user environment is isolation and you are proposing a scheme where the application can be updated from any user account on the machine. There is no way to do this "properly".
Thanks for your opinion.
If you're using /opt on Linux, and it will simplify things to just use the same path, then I don't really see a problem doing that either tbh.


I think usdmatt was right. /opt/ foo Which is where we assumed. But wanted to double-check.
 
Back
Top