Useful Commands/Package Management: Difference between revisions
Jump to navigation
Jump to search
(→Ubuntu) |
(→Ubuntu) |
||
| Line 16: | Line 16: | ||
| 查詢已安裝套件 || | | 查詢已安裝套件 || | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
dpkg --get-selections | dpkg --get-selections | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
| 查詢未安裝套件的版本資訊 || | | 查詢未安裝套件的版本資訊 || | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo apt-cache show openssl | sudo apt-cache show openssl | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
| 查詢已安裝套件的版本資訊 || | | 查詢已安裝套件的版本資訊 || | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
dpkg -s openssl | grep '^Version' | dpkg -s openssl | grep '^Version' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Revision as of 06:19, 15 July 2026
Ubuntu
| 情境 | 指令 |
|---|---|
| List how many top packages installed by me. |
apt-mark showmanual | grep -E 'top$'
|
| List files owned by package |
dpkg -L openvino-2026.2.1
|
| 查詢已安裝套件 |
dpkg --get-selections
|
| 查詢未安裝套件的版本資訊 |
sudo apt-cache show openssl
|
| 查詢已安裝套件的版本資訊 |
dpkg -s openssl | grep '^Version'
|
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
|