/opt and /usr directories in Linux system

Important: usr is the abbreviation of Unix Software Resource, that is, the directory where "UNIX operating system software resources" are placed.

The following is an article I found suitable for a Windows-to-Linux novice like me.

Refhttps://blog.csdn.net/aqxin/article/details/48324377

Linux software installation directory is also very particular, understanding this is beneficial to system management

/usr: System-level directory, which can be understood as C:/Windows/, /usr/libunderstood as C:/Windows/System32.
/usr/local: User-level program directory, which can be understood as C:/Progrem Files/. The software compiled by the user will be installed in this directory by default.
/opt: User-level program directory. It can be understood D:/Softwarethat opt ​​has an optional meaning. It can be used to place third-party large-scale software (or games) here. When you don't need it, just rm -rfdrop it. When the hard disk capacity is not enough, you can also mount /opt separately to other disks for use.

Where is the source code?
/usr/src: The system-level source code directory.
/usr/local/src: User-level source directory.

 

-----------------translate-------------------

/opt

Here's where optional stuff is put. Trying out the latest Firefox beta? Install it to /opt where you can delete it without affecting other settings. Programs in here usually live inside a single folder whick contains all of their data, libraries, etc.
here Mainly store those optional programs. Do you want to try the latest beta version of firefox? Then install it in the /opt directory, so that when you finish trying and want to delete firefox, you can delete it directly without affecting any other settings of the system. For programs installed in the /opt directory, all its data, library files, etc. are placed in the same directory.
For example, the beta version of firefox you just installed can be installed in the /opt/firefox_beta directory. The /opt/firefox_beta directory contains all the files, libraries, data, etc. needed to run firefox. To delete firefox, you just need to delete the /opt/firefox_beta directory, very simple.

 

/usr/local

This is where most manually installed(ie. outside of your package manager) software goes. It has the same structure as /usr. It is a good idea to leave /usr to your package manager and put any custom scripts and things into /usr/local, since nothing important normally lives in /usr/local.

It mainly stores those software installed manually, that is, software not installed through "Synaptic" or apt-get. It has a similar directory structure to the /usr directory. Let the package manager manage the /usr directory and put custom scripts (scripts) under the /usr/local directory, I think it should be a good idea.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325027009&siteId=291194637