套件管理

入門閱讀

Package / pamac

Packages

Wiki

使用情境範例

查詢檔案屬於那個套件

執行下面指令,查詢「/usr/share/icons/Papirus」這個檔案,是屬於那個套件。

pacman -Qo /usr/share/icons/Papirus

顯示

/usr/share/icons/Papirus/ is owned by papirus-icon-theme 20210901-1

也可以加上「-q」,也就是執行下面指令

pacman -Qo /usr/share/icons/Papirus -q

顯示

papirus-icon-theme

查詢套件安裝那些檔案

執行下面指令,查詢「papirus-icon-theme」這個套件,安裝那些檔案在系統上。

pacman -Ql papirus-icon-theme

顯示

papirus-icon-theme /usr/
papirus-icon-theme /usr/share/
papirus-icon-theme /usr/share/icons/
papirus-icon-theme /usr/share/icons/Papirus-Dark/
papirus-icon-theme /usr/share/icons/Papirus-Dark/128x128
papirus-icon-theme /usr/share/icons/Papirus-Dark/16x16/
papirus-icon-theme /usr/share/icons/Papirus-Dark/16x16/actions/
papirus-icon-theme /usr/share/icons/Papirus-Dark/16x16/actions/Finished.svg
papirus-icon-theme /usr/share/icons/Papirus-Dark/16x16/actions/Info-amarok.svg
papirus-icon-theme /usr/share/icons/Papirus-Dark/16x16/actions/SuggestionError.svg
...

顯示的格式是「套件名稱 檔案路徑」,

若不要顯示「套件名稱」,則是執行下面指令,後面多加一個「-q」

pacman -Ql papirus-icon-theme -q

顯示

/usr/
/usr/share/
/usr/share/icons/
/usr/share/icons/Papirus-Dark/
/usr/share/icons/Papirus-Dark/128x128
/usr/share/icons/Papirus-Dark/16x16/
/usr/share/icons/Papirus-Dark/16x16/actions/
/usr/share/icons/Papirus-Dark/16x16/actions/Finished.svg
/usr/share/icons/Papirus-Dark/16x16/actions/Info-amarok.svg
/usr/share/icons/Papirus-Dark/16x16/actions/SuggestionError.svg
...

另外查詢的時候,也可以不加上「套件」,就會列出系統所有安裝的檔案

pacman -Ql

一樣可以加上「-q」

pacman -Ql -q

也可以搭配「分頁程式」

pacman -Ql | less
pacman -Ql -q | less
pacman -Ql | bat
pacman -Ql -q | bat