pacman -S

パッケージと実行環境

書き方

sudo pacman -S [--needed] <package>

Archのsyncリポジトリからパッケージを入れます。ローリングリリースなので、-Syで一覧だけ更新して入れると部分更新になりライブラリが壊れるため、必ず-Syuで一緒に上げます。

よく使うオプション

オプション意味
-Syurefresh and upgrade the whole system, the supported way to update
--neededdo not reinstall packages already at that version
--noconfirmno prompts, for scripts
-Ss <pattern>search the repositories
-R <package>remove a package
-Qi <package>show what is installed and why

sudo pacman -S ripgrep

installs from the sync repositories

sudo pacman -Syu

the full upgrade Arch expects you to run

sudo pacman -S --needed base-devel

installs 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