Bird
0
0

You want to automate updating your system and cleaning unused packages in one script. Which sequence of commands is correct?

hard📝 Application Q8 of 15
Linux CLI - Package Management
You want to automate updating your system and cleaning unused packages in one script. Which sequence of commands is correct?
Aapt autoremove && apt update && apt upgrade
Bapt update && apt upgrade -y && apt autoremove -y
Capt upgrade && apt update && apt autoremove
Dapt clean && apt update && apt install
Step-by-Step Solution
Solution:
  1. Step 1: Determine correct order for update and upgrade

    First, run apt update to refresh package lists, then apt upgrade to upgrade packages.
  2. Step 2: Clean unused packages after upgrade

    apt autoremove removes unused dependencies after upgrades.
  3. Step 3: Check options for correct order and flags

    apt update && apt upgrade -y && apt autoremove -y uses correct order and -y to auto-confirm prompts.
  4. Final Answer:

    apt update && apt upgrade -y && apt autoremove -y -> Option B
  5. Quick Check:

    Update, upgrade, then autoremove = apt update && apt upgrade -y && apt autoremove -y [OK]
Quick Trick: Update first, then upgrade, then autoremove unused packages [OK]
Common Mistakes:
  • Running upgrade before update
  • Cleaning before upgrading
  • Using apt clean instead of autoremove

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes