Opt path in linux

1.13. /opt

This directory is reserved for all the software and add-on packages that are not part of the default installation. For example, StarOffice, Kylix, Netscape Communicator and WordPerfect packages are normally found here. To comply with the FSSTND, all third party applications should be installed in this directory. Any package to be installed here must locate its static files (ie. extra fonts, clipart, database files) must locate its static files in a separate /opt/’package’ or /opt/’provider’ directory tree (similar to the way in which Windows will install new software to its own directory tree C:\Windows\Progam Files\»Program Name»), where ‘package’ is a name that describes the software package and ‘provider’ is the provider’s LANANA registered name.

Although most distributions neglect to create the directories /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, and /opt/man they are reserved for local system administrator use. Packages may provide «front-end» files intended to be placed in (by linking or copying) these reserved directories by the system administrator, but must function normally in the absence of these reserved directories. Programs to be invoked by users are located in the directory /opt/’package’/bin. If the package includes UNIX manual pages, they are located in /opt/’package’/man and the same substructure as /usr/share/man must be used. Package files that are variable must be installed in /var/opt. Host-specific configuration files are installed in /etc/opt.

Under no circumstances are other package files to exist outside the /opt, /var/opt, and /etc/opt hierarchies except for those package files that must reside in specific locations within the filesystem tree in order to function properly. For example, device lock files in /var/lock and devices in /dev. Distributions may install software in /opt, but must not modify or delete software installed by the local system administrator without the assent of the local system administrator.

The use of /opt for add-on software is a well-established practice in the UNIX community. The System V Application Binary Interface [AT&T 1990], based on the System V Interface Definition (Third Edition) and the Intel Binary Compatibility Standard v. 2 (iBCS2) provides for an /opt structure very similar to the one defined here.

Читайте также:  Редактировать файл linux команда

Generally, all data required to support a package on a system must be present within /opt/’package’, including files intended to be copied into /etc/opt/’package’ and /var/opt/’package’ as well as reserved directories in /opt. The minor restrictions on distributions using /opt are necessary because conflicts are possible between distribution installed and locally installed software, especially in the case of fixed pathnames found in some binary software.

The structure of the directories below /opt/’provider’ is left up to the packager of the software, though it is recommended that packages are installed in /opt/’provider’/’package’ and follow a similar structure to the guidelines for /opt/package. A valid reason for diverging from this structure is for support packages which may have files installed in /opt/ ‘provider’/lib or /opt/’provider’/bin.

Источник

Use of /opt and /usr/local directories in the context of a PC

What is the difference between /opt and /usr/local directories and what kind of programs should be installed to them? I referred to Linux File-system Hierarchy but the explanation is not that clear. According to above link; /opt :- This directory is reserved for all the software and add-on packages that are not part of the default installation /usr/local :- The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. In the context of a PC without any networked computers what should be the directory to install a software that will be accessed by multiple local users? (i.e. where should I install a software like netbeans) Thank you

Lol..I came late to the party ..But it seems like you people have opt imized the comments section a lot. P

3 Answers 3

/opt is for third-party applications that don’t rely on any dependencies outside the scope of said package. /usr/local is for packages installed on this machine outside the scope of the distribution package manager.

An open source sip-client supplied as a .deb would install into /usr . If it was built with the Qt framework, apt would pull it in as a dependency.

The same open source sip-client built from source would reside in /usr/local so it would not be messed up by apt if you later installed a .deb package for the same application. You could either build its dependencies from source, or get them from the package manager.

A third-party application in /opt is supposed to be self-contained. For instance, a proprietary sip-client using Qt would not rely on the version from apt, but would have it bundled or statically linked in.

Читайте также:  Узнать версию линукс консоли

For more information, take a look at the Filesystem Hierarchy Standard.

Источник

What is the difference between /opt and /usr/local?

According to the Filesystem Hierarchy Standard, /opt is for «the installation of add-on application software packages». /usr/local is «for use by the system administrator when installing software locally». These use cases seem pretty similar. Software not included with distributions usually is configured by default to install in either /usr/local or /opt with no particular rhyme or reason as to which they chose. Is there some difference I’m missing, or do both do the same thing, but exist for historical reasons?

My understanding is that /usr/local is a local version of /usr file system, whereas /opt is place holder for misc stuff.

9 Answers 9

While both are designed to contain files not belonging to the operating system, /opt and /usr/local are not intended to contain the same set of files.

/usr/local is a place to install files built by the administrator, typically by using the make command (e.g., ./configure; make; make install ). The idea is to avoid clashes with files that are part of the operating system, which would either be overwritten or overwrite the local ones otherwise (e.g., /usr/bin/foo is part of the OS while /usr/local/bin/foo is a local alternative).

All files under /usr are shareable between OS instances, although this is rarely done with Linux. This is a part where the FHS is slightly self-contradictory, as /usr is defined to be read-only, but /usr/local/bin needs to be read-write for local installation of software to succeed. The SVR4 file system standard, which was the FHS’ main source of inspiration, is recommending to avoid /usr/local and use /opt/local instead to overcome this issue.

/usr/local is a legacy from the original BSD. At that time, the source code of /usr/bin OS commands were in /usr/src/bin and /usr/src/usr.bin , while the source of locally developed commands was in /usr/local/src , and their binaries in /usr/local/bin . There was no notion of packaging (outside tarballs).

On the other hand, /opt is a directory for installing unbundled packages (i.e. packages not part of the Operating System distribution, but provided by an independent source), each one in its own subdirectory. They are already built whole packages provided by an independent third party software distributor. Unlike /usr/local stuff, these packages follow the directory conventions (or at least they should). For example, someapp would be installed in /opt/someapp , with one of its command being /opt/someapp/bin/foo , its configuration file would be in /etc/opt/someapp/foo.conf , and its log files in /var/opt/someapp/logs/foo.access .

Читайте также:  Загрузочная флешка windows 10 linux fedora

Источник

Linux: What is Opt Directory and How to Open Opt Directory

Linux: What is opt directory used for? Know how to open opt file in Ubuntu terminal and how to change permission of opt folder in Ubuntu. The /opt is for “the installation of add-on application software packages”. /opt is reserved for the installation of such software packages.

/opt Directory

Note that the directories /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, and /opt/man are reserved for local system administrator use. Also note that the package files that are variable must be installed in /var/opt. Whereas the host-specific configuration files must be installed in /etc/opt.

In general terms, the /opt directory is reserved for all the software and add-on packages that are not part of the default installation. For example, all third party applications should be installed in this directory. Any package to be installed here must locate its static files in a separate /opt/’package’ or /opt/’provider’ directory tree. Under no circumstances are other package files to exist outside the /opt, /var/opt, and /etc/opt hierarchies except for those package files that must reside in specific locations within the filesystem tree in order to function properly.

Generally, all data required to support a package on a system must be present within /opt/’package’, including files intended to be copied into /etc/opt/’package’ and /var/opt/’package’ as well as reserved directories in /opt. The minor restrictions on distributions using /opt are necessary because conflicts are possible between distribution installed and locally installed software, especially in the case of fixed pathnames found in some binary software.

Permissions for /opt Directory

The default permissions for /opt are drwxr-xr-x with ownership root:root. Users can manually set this ownership and permissions:

sudo chown root:root /opt
sudo chmod 0755 /opt

Open /opt in Ubuntu

Ubuntu users can easily open /opt in Ubuntu. To open it via Terminal, use CD and navigate to the opt folder and simply use ls command to see the contents of the directory. Users can also access the /opt directory graphically. Open files tab and select the opt folder.

Источник

Оцените статью
Adblock
detector