Courseiva
mediumMultiple Choice

XK0-006 Practice Question: After using 'apt-get install' to install several…

After using 'apt-get install' to install several packages, the administrator notices that disk space is low. Which command cleans up the package cache?

⚠ Common exam trap

A common mistake on the Linux+ exam is confusing 'autoremove' (which removes orphaned dependencies) with 'clean' (which clears the download cache).

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

apt-get clean

The 'apt-get clean' command removes all package files (.deb) from the local cache located in /var/cache/apt/archives/. This frees up disk space without affecting installed packages, as the cache is only used for future installations or reinstallations. It is the correct command to clean up the package cache after installations.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    apt-get clean

    Why this is correct

    `apt-get clean` deletes every cached `.deb` archive from `/var/cache/apt/archives`, immediately reclaiming the disk space consumed by the packages just installed. This directly satisfies the low-disk constraint, unlike `autoremove`, which removes orphaned dependencies rather than cached package files.

  • ✗

    apt-get purge

    Why it's wrong here

    purge uninstalls packages and deletes their configuration files, but leaves the cached .deb archives untouched, so the space is not reclaimed. It is tempting because it deletes more than remove, but its purpose is erasing package configuration, which suits fully removing software rather than clearing the download cache.

  • ✗

    apt-get autoremove

    Why it's wrong here

    autoremove deletes orphaned dependencies, not cached .deb files, so it frees little space here. It is tempting because it does reclaim disk, but its purpose is removing packages no longer required by anything, which suits tidying after dependency changes rather than clearing the download cache.

  • ✗

    apt-get remove

    Why it's wrong here

    remove uninstalls named packages while leaving their cached .deb archives in /var/cache/apt/archives, so disk usage barely changes. It is tempting as a disk-space command, but its purpose is deleting installed software, which suits removing unwanted packages rather than purging downloaded cache files.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 781 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.