LFCS · Question #738
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. On dpkg-based systems, the apt-get update command is used to download the latest package information from configured repositories.
Question
Options
- Aapt-get update
- Bapt-get upgrade
- Capt-cache update
- Dapt-get refresh
- Eapt-cache upgrade
How the community answered
(39 responses)- A95% (37)
- B3% (1)
- C3% (1)
Why each option
On dpkg-based systems, the `apt-get update` command is used to download the latest package information from configured repositories.
The `apt-get update` command downloads the package lists from the repositories and 'updates' them to get information on the newest versions of packages and their dependencies. This command does not install or upgrade any packages, but rather updates the local cache of available packages.
`apt-get upgrade` installs newer versions of the currently installed packages from the sources enumerated in `/etc/apt/sources.list`, but it does not update the list of available packages first.
`apt-cache update` is not a valid command; `apt-cache` is used to query information from the package cache, not update it from remote repositories.
`apt-get refresh` is not a standard `apt-get` command for updating package lists; the correct command is `apt-get update`.
`apt-cache upgrade` is not a valid command; `apt-cache` is for querying the cache, not for upgrading packages.
Concept tested: APT package manager update command
Source: https://manpages.ubuntu.com/manpages/jammy/en/man8/apt-get.8.html
Topics
Community Discussion
No community discussion yet for this question.