pacman -S
套件與執行環境
用法
sudo pacman -S [--needed] <package>從 Arch 的 sync 軟體庫安裝套件;因為是滾動發行,只用 -Sy 更新列表再安裝會造成部分升級、把函式庫搞壞,所以一律用 -Syu。
常用選項
| 選項 | 含義 |
|---|---|
| -Syu | refresh and upgrade the whole system, the supported way to update |
| --needed | do not reinstall packages already at that version |
| --noconfirm | no prompts, for scripts |
| -Ss <pattern> | search the repositories |
| -R <package> | remove a package |
| -Qi <package> | show what is installed and why |
範例
sudo pacman -S ripgrepinstalls from the sync repositories
sudo pacman -Syuthe full upgrade Arch expects you to run
sudo pacman -S --needed base-develinstalls the group, skipping what is there
問題永遠是什麼裝到哪裡:裝進這個專案,還是裝到整台機器上。
怎麼看
- 方括號 [ ] 表示這部分可以不寫。
- 省略號 … 表示可以寫多個。
- 選項區分大小寫——有些命令裡 -r 和 -R 不是一回事。
常見問題
Q. pacman -S 是做什麼的?
從 Arch 的 sync 軟體庫安裝套件;因為是滾動發行,只用 -Sy 更新列表再安裝會造成部分升級、把函式庫搞壞,所以一律用 -Syu。
Q. 怎麼寫?
sudo pacman -S [--needed] <package> —— 方括號表示可以省略的部分。
Q. 值得記的選項有幾個?
這裡列了 6 個,完整列表在 man pacman。這條命令屬於套件與執行環境。
相關命令
man 手冊: man pacman--S