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