Select the proper candidate
When there are multiple candidates to choose from, pick the correct package, not the first one. It would be:
- If the Install request actually asks for something specific (maybe this goes for a future task, because it might be brought in as a dependency first)
- Priority of the repository.
- Version number of the package.
- Order of the repositories in the configuration.