Define an additional YUM repository in its own .repo file.
Keep the host-wide main configuration separate.
Which location is appropriate?
Additional repository definitions normally live as .repo files under /etc/yum.repos.d/.
Detailed explanation
/var/cache/yum/vendor.repoIncorrect. /var/cache/yum is a cache area, not the persistent configuration directory.
Incorrect. /var/cache/yum is a cache area, not the persistent configuration directory.
/etc/rpm/vendor.repoIncorrect. YUM does not use /etc/rpm for standard repository files.
Incorrect. YUM does not use /etc/rpm for standard repository files.
/etc/yum.repos.d/vendor.repoCorrect. /etc/yum.repos.d/vendor.repo is the conventional location.
Correct. /etc/yum.repos.d/vendor.repo is the conventional location.
/usr/share/yum/vendor.repoIncorrect. Host-specific administrator configuration belongs under /etc, not /usr/share.
Incorrect. Host-specific administrator configuration belongs under /etc, not /usr/share.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' /etc/yum.repos.d/vendor.repoExpected result
/etc/yum.repos.d/vendor.repoKey points
- Use the .repo extension
- /etc/yum.repos.d is standard
- Repository IDs should be unique
Notes
- Environment: 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.