The file /etc/yum.repos.d/epel.repo defines a repository with the alias 'epel' and the setting enabled=0. You need to install the package 'htop' from it once, without leaving the repository switched on for future transactions. Which command does that?

LPIC-1 Exam 101-500, objective 102. Linux installation and package management medium

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

The options

Correct yum --enablerepo=epel install htop

Correct. --enablerepo turns a configured but disabled repository on for the duration of this single command, leaving the .repo file untouched.

Not correct yum --disablerepo=epel install htop

Wrong, and the inverse. --disablerepo excludes a repository from the transaction; naming an already disabled one changes nothing and the package is still not found.

Not correct yum-config-manager --enable epel && yum install htop

Wrong for this requirement. This works, but it rewrites enabled=1 into the .repo file, so the repository stays active for every later transaction.

Not correct yum --nogpgcheck install htop

Wrong. --nogpgcheck skips signature verification of the packages in a transaction; it has no bearing on which repositories are consulted.

Why

Each file in /etc/yum.repos.d/ holds one or more repository sections whose header is the repository id, followed by keys such as baseurl or metalink, enabled and gpgcheck; global defaults live in /etc/yum.conf (on dnf systems a link to /etc/dnf/dnf.conf). The rule is that --enablerepo and --disablerepo are per-invocation overrides of the enabled key, while editing the file or using the config-manager subcommand makes the change persistent. Both options accept shell-style globs, so --enablerepo='epel*' is valid.

Where this comes from

Cited
manual page yum(8)

Practise this

Reading one question is not practice. The trainer will draw a short set from objective 102 and space the ones you get wrong.

Practise LPIC-1 Exam 101-500

More questions on this objective

All questions on Linux installation and package management

Practise LPIC-1 Exam 101-500