Bird
0
0

What will be the output of the following commands sequence?

medium📝 Command Output Q13 of 15
Linux CLI - Package Management
What will be the output of the following commands sequence?
sudo apt update
sudo apt upgrade -y
AThe system installs new packages listed in the upgrade command.
BThe system refreshes package lists and upgrades all upgradable packages automatically.
CThe system removes all outdated packages without confirmation.
DThe system only updates package lists but does not upgrade any packages.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze sudo apt update

    This command refreshes the package lists from repositories to get the latest versions.
  2. Step 2: Analyze sudo apt upgrade -y

    This command upgrades all installed packages that have updates available, and the -y flag confirms automatically.
  3. Final Answer:

    The system refreshes package lists and upgrades all upgradable packages automatically. -> Option B
  4. Quick Check:

    Update + upgrade -y = refresh and auto-upgrade [OK]
Quick Trick: Update lists then upgrade with -y to auto-confirm [OK]
Common Mistakes:
  • Thinking upgrade installs new packages
  • Assuming remove happens automatically
  • Believing update upgrades packages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes