XK0-004 · Question #395
A systems administrator needs to write a script that performs unattended package upgrades. Which of the following flags should be used with either yum or apt to meet this goal?
The correct answer is A. -u. Running unattended package upgrades requires a flag that suppresses all interactive confirmation prompts so the script can complete without user input.
Question
A systems administrator needs to write a script that performs unattended package upgrades. Which of the following flags should be used with either yum or apt to meet this goal?
Options
- A-u
- B-q
- C-y
- D-d
How the community answered
(50 responses)- A88% (44)
- B6% (3)
- C4% (2)
- D2% (1)
Why each option
Running unattended package upgrades requires a flag that suppresses all interactive confirmation prompts so the script can complete without user input.
Note - the provided answer is A (-u), but -u in apt-get is the --show-upgraded flag that lists packages to be upgraded and does not suppress prompts. The technically correct answer is -y (choice C): both yum -y and apt-get -y automatically answer 'yes' to all confirmation prompts, enabling fully non-interactive, unattended package upgrade scripts without any manual intervention.
-q (quiet) suppresses informational output but does not answer interactive prompts, so the command still pauses and waits for user confirmation before proceeding.
-y is the correct flag for unattended operation as it configures both yum and apt-get to assume yes on all prompts, making it the technically accurate answer for this goal.
-d in apt-get enables download-only mode, fetching packages without installing or upgrading them, which does not fulfill the unattended upgrade requirement.
Concept tested: Non-interactive package manager flags for automated upgrades
Source: https://man7.org/linux/man-pages/man8/apt-get.8.html
Topics
Community Discussion
No community discussion yet for this question.