【转载】Linux 软件安装到 /usr,/usr/local/ 还是 /opt 目录?
Linux 的軟件安裝目錄是也是有講究的,理解這一點(diǎn),在對(duì)系統(tǒng)管理是有益的
/usr:系統(tǒng)級(jí)的目錄,可以理解為C:/Windows/
/usr/lib:理解為C:/Windows/System32。
/usr/local:用戶(hù)級(jí)的程序目錄,可以理解為C:/Progrem Files/。用戶(hù)自己編譯的軟件默認(rèn)會(huì)安裝到這個(gè)目錄下。/opt:用戶(hù)級(jí)的程序目錄,可以理解為D:/Software,opt有可選的意思,這里可以用于放置第三方大型軟件(或游戲),當(dāng)你不需要時(shí),直接rm -rf掉即可。在硬盤(pán)容量不夠時(shí),也可將/opt單獨(dú)掛載到其他磁盤(pán)上使用。
源碼放哪里?/usr/src:系統(tǒng)級(jí)的源碼目錄。/usr/local/src:用戶(hù)級(jí)的源碼目錄。
?
-----------------翻譯-------------------
/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.
這里主要存放那些可選的程序。你想嘗試最新的firefox測(cè)試版嗎?那就裝到/opt目錄下吧,這樣,當(dāng)你嘗試完,想刪掉firefox的時(shí)候,你就可 以直接刪除它,而不影響系統(tǒng)其他任何設(shè)置。安裝到/opt目錄下的程序,它所有的數(shù)據(jù)、庫(kù)文件等等都是放在同個(gè)目錄下面。
舉個(gè)例子:剛才裝的測(cè)試版firefox,就可以裝到/opt/firefox_beta目錄下,/opt/firefox_beta目錄下面就包含了運(yùn) 行firefox所需要的所有文件、庫(kù)、數(shù)據(jù)等等。要?jiǎng)h除firefox的時(shí)候,你只需刪除/opt/firefox_beta目錄即可,非常簡(jiǎn)單。
?
/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.
這里主要存放那些手動(dòng)安裝的軟件,即不是通過(guò)“新立得”或apt-get安裝的軟件。它和/usr目錄具有相類(lèi)似的目錄結(jié)構(gòu)。讓軟件包管理器來(lái)管理/usr目錄,而把自定義的腳本(scripts)放到/usr/local目錄下面,我想這應(yīng)該是個(gè)不錯(cuò)的主意。
?
?
?
?
轉(zhuǎn)自:
http://itony.me/769.html
http://blog.csdn.net/secondjanuary/article/details/8972453
轉(zhuǎn)載于:https://www.cnblogs.com/ralap7/p/9033172.html
總結(jié)
以上是生活随笔為你收集整理的【转载】Linux 软件安装到 /usr,/usr/local/ 还是 /opt 目录?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 模拟文件上传(一):手动文件上传
- 下一篇: like模糊查询是否走索引