Redhat 7系统无法安装openblas-devel包的问题求助
问题:Yum无法找到openblas-devel包
我尝试执行以下命令安装openblas-devel,但Yum提示找不到该包:
yum install openblas-devel
我的/etc/yum.conf配置如下:
[main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3 [comments abridged] # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d
已尝试的解决方案及结果:
[root@server ec2-user]# subscription-manager repos --enable rhel-*-optional-rpms \ > --enable rhel-*-extras-rpms \ > --enable rhel-ha-for-rhel-*-server-rpms Repositories disabled by configuration. WARNING The yum/dnf plugins: /etc/yum/pluginconf.d/subscription-manager.conf were automatically enabled for the benefit of Red Hat Subscription Management. If not desired, use "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this behavior. [root@server ec2-user]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm Loaded plugins: amazon-id, product-id, rhui-lb, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. epel-release-latest-7.noarch.rpm | 15 kB 00:00:00 Examining /var/tmp/yum-root-QKKmT8/epel-release-latest-7.noarch.rpm: epel-release-7-14.noarch /var/tmp/yum-root-QKKmT8/epel-release-latest-7.noarch.rpm: does not update installed package. Error: Nothing to do [root@server ec2-user]#
解决方案
1. 确认EPEL仓库状态
虽然已安装epel-release,但仓库可能被禁用。执行以下命令检查:
yum repolist enabled | grep epel
若无输出,手动启用仓库:
yum-config-manager --enable epel
之后再次尝试安装:
yum install openblas-devel -y
2. 修复RHUI仓库配置(AWS EC2 RHEL实例)
从输出看这是AWS上的RHEL实例,默认使用RHUI而非官方订阅仓库。执行以下步骤重置缓存并更新仓库:
yum clean all rm -rf /var/cache/yum/* yum update -y
完成后重新尝试安装包。
3. 手动下载并安装包
如果仓库仍无法访问,直接从EPEL下载对应版本的包安装(以RHEL7 x86_64为例):
# 下载包 curl -L https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/openblas-devel-0.3.15-5.el7.x86_64.rpm -o openblas-devel.rpm # 本地安装 yum localinstall openblas-devel.rpm -y
4. 重新安装EPEL仓库
若EPEL配置文件损坏,先卸载再重装:
rpm -e --nodeps epel-release yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
内容的提问来源于stack exchange,提问作者Zach Fara
相关产品推荐
相关产品推荐

