Courseiva

LPIC-1 Linux Installation and Package Management Practice Question

A system has multiple APT repositories configured. The administrator needs to ensure that for a specific package, the version from a particular repository is always preferred over others, regardless of version number. Which configuration would achieve this?

⚠ Common exam trap

It's easy for candidates to confuse apt-mark hold (which only freezes the installed version) with APT pinning (which controls version selection from repositories), leading them to choose option B instead of the correct pinning configuration.

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

✓

Creating a file in /etc/apt/preferences.d/ with a high Pin-Priority for that package and origin

APT's pinning mechanism, configured via files in /etc/apt/preferences.d/, allows an administrator to assign a high Pin-Priority to a specific package from a particular origin (repository). This ensures that version is always preferred during dependency resolution and upgrades, overriding the default version comparison logic.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Editing /etc/apt/sources.list and setting the release in sources.list

    Why it's wrong here

    Setting the release in sources.list merely labels the distribution for that entry; it does not rank repositories, so APT still selects the highest version across all configured sources. APT pinning in /etc/apt/preferences assigns explicit priorities per origin, which is the mechanism the scenario demands.

  • ✗

    Using apt-mark hold on the package after installing from desired repository

    Why it's wrong here

    apt-mark hold only pins the currently installed version, preventing upgrades; it does not express a preference for a repository, so a newer version from another source is still not selected. Pinning via APT preferences assigns a repository priority, which is what the scenario requires.

  • ✓

    Creating a file in /etc/apt/preferences.d/ with a high Pin-Priority for that package and origin

    Why this is correct

    APT pinning uses Pin-Priority values in /etc/apt/preferences.d/ to override version comparison. Assigning a high priority to a specific package and origin forces that repository's version to be selected regardless of whether another repository offers a numerically higher version.

  • ✗

    Adding the repository and using apt-get install -t release package

    Why it's wrong here

    The -t flag sets a one-off target release for that single install command; it does not persist, so later upgrades ignore the preference. Persistent per-repository priority requires APT pinning in /etc/apt/preferences, which is the correct configuration for the stated requirement.

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 402 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 LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.