Display enabled YUM repository IDs, names, and package counts.
The task is about repositories, not package rows.
Which command is appropriate?
yum repolist lists repositories, enabled by default. repolist all can include disabled repositories too.
Detailed explanation
yum listIncorrect. yum list displays package entries.
Incorrect. yum list displays package entries.
yum repolistCorrect. yum repolist displays enabled repositories and counts.
Correct. yum repolist displays enabled repositories and counts.
yum infoIncorrect. yum info displays package details.
Incorrect. yum info displays package details.
yum deplistIncorrect. deplist displays package dependencies.
Incorrect. deplist displays package dependencies.
Try it yourself
An example you can run in a temporary verification environment.
yum repolistExpected result
repo id、repo name、status等のリポジトリ一覧Key points
- repolist lists sources
- Default scope is enabled
- repolist all includes all states
Notes
- Environment: YUM 3.xまたは互換YUM / 読み取り操作
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.