/opt目錄和/usr目錄的區別

Miss_Audrey發表於2017-12-05

/usr/local下一般是你安裝軟體的目錄,這個目錄就相當於在windows下的programefiles這個目錄 /opt這個目錄是一些大型軟體的安裝目錄,或者是一些服務程式的安裝目錄

/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.
/opt
這裡主要存放那些可選的程式。你想嘗試最新的firefox測試版嗎?那就裝到/opt目錄下吧,這樣,當你嘗試完,想刪掉firefox的時候,你就可 以直接刪除它,而不影響系統其他任何設定。安裝到/opt目錄下的程式,它所有的資料、庫檔案等等都是放在同個目錄下面。
舉個例子:剛才裝的測試版firefox,就可以裝到/opt/firefox_beta目錄下,/opt/firefox_beta目錄下面就包含了運 行firefox所需要的所有檔案、庫、資料等等。要刪除firefox的時候,你只需刪除/opt/firefox_beta目錄即可,非常簡單。
/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.
/usr/local
這裡主要存放那些手動安裝的軟體,即不是通過“新立得”或apt-get安裝的軟體。它和/usr目錄具有相類似的目錄結構。讓軟體包管理器來管理/usr目錄,而把自定義的指令碼(scripts)放到/usr/local目錄下面,我想這應該是個不錯的主意

相關文章