220-1102 exam dumps

220-1102 practice question 251 of 828

A+ Core 2. Associate level, CompTIA. Free question with the correct answer and a full explanation.

220-1102 Question 251

Single answerapt

A technician is supporting an Ubuntu workstation that cannot install a package with apt. When the technician runs sudo apt install wireshark, the system returns messages indicating the package lists are outdated and the package cannot be located. Internet connectivity is working, and the repository configuration has not changed. Which action should the technician perform FIRST to resolve this issue?

  1. A

    Run sudo apt update to refresh the local package index

  2. B

    Run sudo apt upgrade to install all available package updates

  3. C

    Run sudo dpkg -i wireshark to force a manual installation

  4. D

    Run sudo apt remove wireshark and then reinstall it

Show answer and explanation

Correct answer: A

Explanation

On Debian-based Linux distributions such as Ubuntu, apt uses repository metadata stored in the local package index. If that index is outdated, apt may report that it cannot locate a package even though the package exists in the configured repositories. The correct first troubleshooting step is sudo apt update, which downloads the latest package lists from the repository sources defined on the system. After that, the technician can retry sudo apt install wireshark. This follows standard package-management practice documented in Debian and Ubuntu apt usage guidance: update refreshes package metadata, upgrade applies available updates, and dpkg is used for local package files rather than repository-based package resolution.

  • A. Correct.

    Correct. apt relies on a local package index to know what packages are available from configured repositories. If the system reports outdated package lists or says a package cannot be located even though the repositories are correct, the first step is to run sudo apt update. This refreshes metadata from the repositories and often resolves package lookup issues.

  • B. Incorrect.

    Incorrect. sudo apt upgrade installs newer versions of already installed packages, but it does not primarily refresh the package index for package discovery. In practice, upgrade is typically done after apt update, and it would not be the first step when apt cannot locate a package due to stale package lists.

  • C. Incorrect.

    Incorrect. dpkg -i installs a local .deb file; it does not search configured repositories or refresh package metadata. This option reflects a common misconception that dpkg is interchangeable with apt. In this scenario, the technician is trying to install from repositories using apt, so refreshing the package list is the appropriate first action.

  • D. Incorrect.

    Incorrect. apt remove wireshark would only apply if wireshark were already installed and needed to be uninstalled. The scenario states the package cannot be installed because apt cannot locate it, so removing it first does not address the root cause. This distractor targets the mistaken idea that reinstalling solves all package problems.

Timed practice exam

Take a 220-1102 practice test under exam conditions

90 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam