在yum仓库中设置优先级,可以通过以下步骤实现:
编辑仓库配置文件:
设置优先级:
示例:
[base] name=CentOS-$releasever - Base baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 <p>[updates] name=CentOS-$releasever - Updates baseurl=<a href="https://www.php.cn/link/b34fcbb8b9dae62f171ff71744191f0e">https://www.php.cn/link/b34fcbb8b9dae62f171ff71744191f0e</a> gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 priority=10</p><p>[extras] name=CentOS-$releasever - Extras baseurl=<a href="https://www.php.cn/link/154fa0133bf213ebda06227166605423">https://www.php.cn/link/154fa0133bf213ebda06227166605423</a> gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 priority=5
如果你不想直接编辑配置文件,可以使用repoquery命令来临时设置优先级。
repoquery --repos
repoquery --setopt=priorities=10 <repo_id>
其中
假设你想将epel仓库的优先级设置为最低(99),可以这样做:
[epel] name=Extra Packages for Enterprise Linux $releasever - $basearch baseurl=<a href="https://www.php.cn/link/fdba1a7e539c5c1cce7293fe6ae09ee6">https://www.php.cn/link/fdba1a7e539c5c1cce7293fe6ae09ee6</a> enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 priority=99
repoquery --setopt=priorities=99 epel
通过以上方法,你可以灵活地设置Yum仓库的优先级,以满足不同的需求。
以上就是Yum仓库的优先级如何设置的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号