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.
More questions on this objective
- A mail server keeps filling its root filesystem because spooled mail and logs grow without bound, and when the disk fills the whole system becomes unusable. Which single change to the disk layout most directly contains that failure? machine-checked
- In LVM terminology, which object is created directly on a partition or whole disk so that its storage can be added to a pool? machine-checked
- You are laying out storage for a general-purpose Linux server. Which TWO of the following are genuine reasons to use LVM for the data filesystems rather than plain partitions? machine-checked
- Which file is the configuration file that GRUB 2 generates, and which administrators are told not to edit by hand on a typical Linux distribution? machine-checked
- You replaced the boot disk in a BIOS/MBR system and need to write the GRUB 2 boot loader into the master boot record of /dev/sda, installing the required GRUB modules under /boot. Which command does that? machine-checked
- On a GRUB 2 system whose configuration file is /boot/grub/grub.cfg, type the grub-mkconfig command — including the option and its argument — that regenerates that file. machine-checked