nerdexam
CompTIA

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.

Scripting, Containers and Automation

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)
  • A
    88% (44)
  • B
    6% (3)
  • C
    4% (2)
  • D
    2% (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.

A-uCorrect

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.

B-q

-q (quiet) suppresses informational output but does not answer interactive prompts, so the command still pauses and waits for user confirmation before proceeding.

C-y

-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-d

-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

#yum#apt#unattended upgrades#package management

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice