Useful Commands/Package Management: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
(Created page with "{| class="wikitable" ! 情境 || 指令 |- ! colspan="2" | OSX |- | 安裝 Beta 版套件 || <source lang="bash"> $ brew info jython jython: stable 2.5.3, devel 2.7-b1 ... $ b...")
 
No edit summary
 
Line 5: Line 5:
|-
|-
| 安裝 Beta 版套件 ||
| 安裝 Beta 版套件 ||
<source lang="bash">
<syntaxhighlight lang="bash">
$ brew info jython
$ brew info jython
jython: stable 2.5.3, devel 2.7-b1
jython: stable 2.5.3, devel 2.7-b1
...
...
$ brew install --devel jython
$ brew install --devel jython
</source>
</syntaxhighlight>
|-
|-
| 看看 brew install 的時候有哪些編譯選項可以用 ||
| 看看 brew install 的時候有哪些編譯選項可以用 ||
<source lang="bash">
<syntaxhighlight lang="bash">
brew info graphviz    # 版本資訊 / 相依套件 / 編譯選項
brew info graphviz    # 版本資訊 / 相依套件 / 編譯選項
brew options graphviz # 只有編譯選項
brew options graphviz # 只有編譯選項
</source>
</syntaxhighlight>
|-
|-
| 移除沒在用的套件 (已經有安裝新版本,但是舊版還在)<br/>注意!! 這個指令可能導致自編譯套件找不到 lib ||
| 移除沒在用的套件 (已經有安裝新版本,但是舊版還在)<br/>注意!! 這個指令可能導致自編譯套件找不到 lib ||
<source lang="bash">
<syntaxhighlight lang="bash">
brew cleanup
brew cleanup
brew cleanup $FORMULA
brew cleanup $FORMULA
brew cleanup -n # dry-run
brew cleanup -n # dry-run
</source>
</syntaxhighlight>
|-
|-
! colspan="2" | Ubuntu
! colspan="2" | Ubuntu
|-
|-
| 查詢已安裝套件 ||
| 查詢已安裝套件 ||
<source lang="bash">
<syntaxhighlight lang="bash">
dpkg --get-selections    # Ubuntu
dpkg --get-selections    # Ubuntu
yum list | grep installed # CentOS
yum list | grep installed # CentOS
</source>
</syntaxhighlight>
|-
|-
| 查詢未安裝套件的版本資訊 ||
| 查詢未安裝套件的版本資訊 ||
<source lang="bash">
<syntaxhighlight lang="bash">
sudo apt-cache show openssl # Ubuntu
sudo apt-cache show openssl # Ubuntu
</source>
</syntaxhighlight>
|-
|-
| 查詢已安裝套件的版本資訊 ||
| 查詢已安裝套件的版本資訊 ||
<source lang="bash">
<syntaxhighlight lang="bash">
dpkg -s openssl | grep '^Version' # Ubuntu
dpkg -s openssl | grep '^Version' # Ubuntu
</source>
</syntaxhighlight>
|}
|}

Latest revision as of 20:22, 3 April 2025

情境 指令
OSX
安裝 Beta 版套件
$ brew info jython
jython: stable 2.5.3, devel 2.7-b1
...
$ brew install --devel jython
看看 brew install 的時候有哪些編譯選項可以用
brew info graphviz    # 版本資訊 / 相依套件 / 編譯選項
brew options graphviz # 只有編譯選項
移除沒在用的套件 (已經有安裝新版本,但是舊版還在)
注意!! 這個指令可能導致自編譯套件找不到 lib
brew cleanup
brew cleanup $FORMULA
brew cleanup -n # dry-run
Ubuntu
查詢已安裝套件
dpkg --get-selections     # Ubuntu
yum list | grep installed # CentOS
查詢未安裝套件的版本資訊
sudo apt-cache show openssl # Ubuntu
查詢已安裝套件的版本資訊
dpkg -s openssl | grep '^Version' # Ubuntu