Refresh the information about available packages and versions in the configured APT repositories.
Do not upgrade installed packages yet.
Which command is appropriate?
apt-get update downloads and refreshes repository indexes. It is separate from upgrading installed package files.
Detailed explanation
apt-get upgradeIncorrect. upgrade updates installed packages using the available indexes.
Incorrect. upgrade updates installed packages using the available indexes.
apt-get installIncorrect. install installs a package.
Incorrect. install installs a package.
apt-get cleanIncorrect. clean removes cached package archives.
Incorrect. clean removes cached package archives.
apt-get updateCorrect. apt-get update refreshes the repository indexes only.
Correct. apt-get update refreshes the repository indexes only.
Try it yourself
An example you can run in a temporary verification environment.
apt-get --help | grep -E '^ update'Expected result
updateサブコマンドの説明。ネットワーク取得は行わないKey points
- update refreshes indexes
- upgrade changes installed packages
- Repository configuration determines the sources
Notes
- Environment: Debian系 / 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.