【问题标题】:Yum repo preference?百胜回购偏好?
【发布时间】:2021-04-05 20:33:02
【问题描述】:

假设我们有两个 yum 存储库,red-repo 和 green-repo,它们都包含 foo-bar-1.0.0.0.rpm

问题是,如果我运行yum install 'foo-bar-1.0.0.0',我可以事先确定 yum 将从哪个 repo 中提取 foo-bar-1.0.0.0.rpm 吗?更广泛地说,是否有一个设置/文件,您可以告诉 yum 如果它们两个 repos 具有相同的文件,则更喜欢哪个 repo?

【问题讨论】:

标签: rpm yum


【解决方案1】:

来自man dnf.conf

cost   integer

The  relative cost of accessing this repository, defaulting to 1000. This value is compared when the priorities of two reposito‐
ries are the same. The repository with the lowest cost is picked. It is useful to make the library prefer  on-disk  repositories
to remote ones.

priority
        integer

The priority value of this repository, default is 99. If there is more than one candidate package for  a  particular  operation,
the  one from a repo with the lowest priority value is picked, possibly despite being less convenient otherwise (e.g. by being a
lower version).

这些设置是旧的,也可用于 YUM。

【讨论】:

    猜你喜欢
    • 2015-05-16
    • 2019-03-24
    • 2011-03-15
    • 2014-08-24
    • 2015-07-24
    • 1970-01-01
    • 1970-01-01
    • 2014-06-28
    • 2019-07-22
    相关资源
    最近更新 更多