linux - yum + 当启用=0 时如何在 yum 中启用 repo
问题描述
我们的 rhel 7.2 服务器上有以下 repo
如我们所见,我们将enabled=0
, 设置为默认值
more infra-update.repo
[infra-76-update]
name=infra 76 update
baseurl=http://linux_machine/infra-76
gpgcheck=0
enabled=0
但是如果我们想使用这个 repo - infra-7.6
,我们编写以下 yum 语法
yum --disablerepo=* --enablerepo=infra-76 update -y
但我们得到
Error getting repository data for infra-76, repository not found
但是当我们设置 时enabled=1
,我们可以使用 - ( yum --disablerepo=* --enablerepo=infra-76 update -y
)成功安装 yum
但问题是:
是否可以将 repo 启用为yum --disablerepo=* --enablerepo=infra-76
, while enabled=0
??
注意 - 目标是从 repo 安装 rpm infra-76
,尽管 repo config 中的参数是enabled=0
解决方案
您可以使用yum-config-manager
(您可能需要安装yum-utils
):
yum-config-manager --enable infra-76
标志--disablerepo
和--enablerepo
临时禁用/启用存储库(仅用于该命令,在这种情况下仅用于运行yum update
一次)。
推荐阅读
- npm - 对于 ADO 管道上的 dotnet 发布,使用私有源的 NPM 身份验证失败
- javascript - 使用 JavaScript 从数组中的字符串中删除所有字母字符和前导零
- symfony - EventSubscriber 中的 Symfony getUser()
- r - poly(x,2)2 的含义是什么?
- html - 在 vuetify 中删除 v-select 中的额外输入
- javascript - 在 WordPress 菜单中使用 JS 变量失败
- javascript - 嵌套对象的对象到对象数组,其中添加了原始键作为值
- javascript - 如果我从一个 onclick 事件中组合两个功能,我可以创建警报吗?(纯 Javascript)
- javascript - 如何从字符串中导入 iframe html 代码
- git - Azure 发布管道:使用提交同步文件