apt update has already completed.
Update currently installed packages to available newer candidate versions.
Which command is appropriate?
apt upgrade uses refreshed indexes to update installed packages. apt update itself only refreshes the indexes.
Detailed explanation
apt upgradeCorrect. apt upgrade updates installed packages using the current indexes.
Correct. apt upgrade updates installed packages using the current indexes.
apt updateIncorrect. apt update does not install new package versions.
Incorrect. apt update does not install new package versions.
apt listIncorrect. apt list displays package lists.
Incorrect. apt list displays package lists.
apt search upgradeIncorrect. This searches for a package named upgrade.
Incorrect. This searches for a package named upgrade.
Try it yourself
An example you can run in a temporary verification environment.
apt-get -s upgradeExpected result
更新計画が表示され、-sによりパッケージは変更されないKey points
- update and upgrade are separate
- Refresh indexes first
- -s can preview changes
Notes
- Environment: APT 2.x / シミュレーション
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.