/opt is the FHS location for optional, self-contained application packages that do not integrate with the main filesystem hierarchy. Each package typically gets its own subdirectory like /opt/google/chrome/, /opt/mongodb/, or /opt/virtualbox/. Inside, the vendor lays out whatever structure they please—often bin/, lib/, share/—which keeps their files separate from the distribution's package manager.
Compared with /usr/local, which expects software to integrate with the Unix layout (binaries in bin/, libraries in lib/, manpages in share/man/), /opt is for drop-it-all-in-one-place distributions typical of commercial or bundled software. It was originally standardised by Unix System V to give third-party vendors a predictable place to put their products without treading on distribution files.
On modern Linux, the role of /opt has been partly absorbed by containers, Snap, Flatpak, and AppImage, all of which provide various kinds of self-contained packaging. But it is still common to see browsers, proprietary databases, and enterprise applications installed there, and a tidy sysadmin convention is to symlink their binaries into /usr/local/bin/ so that they appear on the default $PATH.
Related terms: Filesystem Hierarchy Standard, /usr
Discussed in:
- Chapter 4: The Filesystem Hierarchy — /opt — Optional Packages
Also defined in: Textbook of Linux