apt update
パッケージと実行環境
書き方
sudo apt updateパッケージ一覧を取り直すだけです。これだけでは何も入らず上がらないのでapt upgradeが続き、作りたてのコンテナは一覧が空なのでまずこれを打ちます。
よく使うオプション
| オプション | 意味 |
|---|---|
| apt upgrade | the second half: actually install the newer versions |
| apt full-upgrade | allow packages to be removed to finish the upgrade |
| apt list --upgradable | show what the refresh found |
| -q | quieter output for logs and CI |
| --allow-releaseinfo-change | accept a repository that renamed its suite |
例
sudo apt updaterefreshes the package lists only
sudo apt update && sudo apt upgrade -yrefresh, then install the updates
apt list --upgradablelists the packages that now have a newer version
何をどこに入れるかが問題です。このプロジェクトの中か、マシン全体かを先に決めてください。
読み方
- 角括弧 [ ] は省いてよい部分です。
- 三点 … は複数並べられるという意味です。
- オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。
よくある質問
Q. apt update は何をしますか。
パッケージ一覧を取り直すだけです。これだけでは何も入らず上がらないのでapt upgradeが続き、作りたてのコンテナは一覧が空なのでまずこれを打ちます。
Q. どう打ちますか。
sudo apt update — 角括弧は省いてよい部分です。
Q. よく使うオプションはいくつですか。
ここにまとめたのは5個です。全部は man apt にあります。このコマンドはパッケージと実行環境の仲間です。
関連するコマンド
man ページ: man apt-update