What is opt directory in linux

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 .

Читайте также:  Run android emulator linux

Источник

What does «opt» mean (as in the «opt» directory)? Is it an abbreviation? [closed]

What does «opt» mean (as in the «opt» directory)? I commonly see this directory in Unix systems with development tools inside. Is it an abbreviation?

I always imagined it meant «optional» but it never made sense to me either. «optional» in what sense?

It should’ve been posted on either Super User or the Unix Stack Exchange site — it isn’t really about programming.

FYI, Adobe Reader chooses /opt as its installation directory. (Which is what lead me to this thread.)

I’ve seen many people put their cross-compiling toolchains in /opt/. Is there some historical reason for this?

5 Answers 5

In the old days, «/opt» was used by UNIX vendors like AT&T, Sun, DEC and 3rd-party vendors to hold «Option» packages; i.e. packages that you might have paid extra money for. I don’t recall seeing «/opt» on Berkeley BSD UNIX. They used «/usr/local» for stuff that you installed yourself.

But of course, the true «meaning» of the different directories has always been somewhat vague. That is arguably a good thing, because if these directories had precise (and rigidly enforced) meanings you’d end up with a proliferation of different directory names.

«/opt is reserved for the installation of add-on application software packages.«

By contrast it says this about «/usr/local/*»:

«The /usr/local hierarchy is for use by the system administrator when installing software locally.«

These days, «/usr/local/*» is typically used for installing software that has been built locally, possibly after tweaking configuration options, etcetera.

Источник

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.

Читайте также:  Запуск network manager kali linux

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.

Filed Under: Uncategorized Tagged With: directory, linux, open, what

Primary Sidebar

  • 3 Ways to Disable GetApps on Xiaomi, Redmi, and Poco Phones Running MIUI 1.9k views
  • 8 Best Sites to Read Manga Online for Free 1.6k views
  • How To Extract & Install tar.gz Files In Ubuntu 1.4k views
  • Exclamation Mark on Network Signal, Mobile Data Not Working? 8 Ways to Fix 1.4k views
  • [Working] Remove Blue Circle From Your Samsung Phone Touchscreen 1k views
  • How To Search On Google Using Image or Video 1k views
  • How to Fix YouTube Server Connection Error [400] on Android 0.9k views
  • Discord Stream Has No Sound? 6 Ways to Fix 0.9k views
  • How To Install Android App APK on Samsung Tizen OS Device 0.9k views
  • 3 Ways to Hide Tabs in Google Chrome 0.9k views
  • How to Copy Paste in Linux Terminal [For Absolute Beginners] 0.9k views
  • Troubleshooting “E: Unable to locate package” Error on Ubuntu [Beginner’s Tutorial] 800 views
  • How to find a lost Apple Pencil using your iPad (1st and 2nd gen) 800 views
  • Service Host Network Service High network usage in Windows 11/10 800 views
  • How to Create a Multi-Page PDF in Photoshop 700 views
  • Linux: What is Opt Directory and How to Open Opt Directory 700 views
  • How do I enable or disable Alt Gr key on Windows 10 keyboard 700 views
Читайте также:  Linux nvidia power limit

Источник

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