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.
/etc/rpm/vendor.repoIncorrect. 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.
/usr/share/yum/vendor.repoIncorrect. 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設定構造の確認のみ
- Use a disposable system or transaction preview before package changes.
- YUM compatibility layers can expose different subcommands across distributions.
Foundation review
Place the operation
Persistent repository configuration belongs under /etc, separate from regenerable cache data.
Check the side effect
Validate the repository ID and signature-checking settings before enabling it.