LX0-103 · Question #138
Which of the following commands is used to update the list of available packages when using dpkg based package management?
The correct answer is A. apt-get update. apt-get update synchronizes the local package index with the remote repositories, making newly available packages visible to the package manager.
Question
Which of the following commands is used to update the list of available packages when using dpkg based package management?
Options
- Aapt-get update
- Bapt-get upgrade
- Capt-cache update
- Dapt-get refresh
- Eapt-cache upgrade
How the community answered
(42 responses)- A93% (39)
- B5% (2)
- D2% (1)
Why each option
apt-get update synchronizes the local package index with the remote repositories, making newly available packages visible to the package manager.
apt-get update downloads the package lists from all configured sources in /etc/apt/sources.list and refreshes the local index. This does not install or upgrade anything - it only updates the metadata so that subsequent commands like apt-get install or apt-get upgrade know what packages and versions are available.
apt-get upgrade installs newer versions of all currently installed packages - it does not update the package index list.
apt-cache is a tool for querying the local package cache; it has no 'update' subcommand.
'apt-get refresh' is not a valid apt-get subcommand and will produce an error.
'apt-cache upgrade' is not a valid apt-cache subcommand.
Concept tested: Updating dpkg-based package index with apt-get
Source: https://manpages.debian.org/stable/apt/apt-get.8.en.html
Topics
Community Discussion
No community discussion yet for this question.