191 字
1 分钟
Redhat7.4、Redhat8.1在线仓库解决方案

最近莫名其妙玩起Redhat,但是因为系统特殊性yum命令被限制,因此才会有这个笔记的诞生

版本: Red Hat Enterprise Linux release 8.1 (Ootpa) Red Hat Enterprise Linux Server release 7.4 (Maipo)

解决8版本的问题#

Terminal window
[root@rhel8 ~]# rpm -qa | grep yum
yum-4.2.7-6.el8.noarch
[root@rhel8 ~]# rpm -e yum-* --nodeps
[root@rhel8 ~]# curl -o /etc/yum.repos.d/Centos8.repo https://mirrors.aliyun.com/repo/Centos-8.repo
[root@rhel8 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/yum-4.7.0-4.el8.noarch.rpm
[root@rhel8 ~]# yum clean all && yum makecache

解决7版本的问题#

Terminal window
[root@rhel7 ~]# rpm -qa | grep yum
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-154.el7.noarch
yum-rhn-plugin-2.0.1-9.el7.noarch
[root@rhel7 ~]# rpm -qa | grep yum | xargs rpm -e --nodeps
[root@rhel7 ~]# mkdir /etc/yum.repos.d/
[root@rhel7 ~]# curl -o /etc/yum.repos.d/Centos7.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@rhel7 ~]# sed -in 's#\$releasever#7#g' /etc/yum.repos.d/Centos7.repo
[root@rhel7 ~]# sed -in 's#\$basearch#x86_64#g' /etc/yum.repos.d/Centos7.repo
[root@rhel7 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-4.11.3-45.el7.x86_64.rpm
[root@rhel7 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[root@rhel7 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
[root@rhel7 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
[root@rhel7 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
[root@rhel7 ~]# rpm -ivh --nodeps https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/wget-1.14-18.el7_6.1.x86_64.rpm
[root@rhel7 ~]# yum clean all && yum makecache
Redhat7.4、Redhat8.1在线仓库解决方案
http://blog.xeu.asia/posts/linux环境基础配置/redhat74-81在线仓库解决方案/
作者
Xeu
发布于
2024-12-24
许可协议
CC BY-NC-SA 4.0