RedHat7安装yum工具
Posted hx1998
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RedHat7安装yum工具相关的知识,希望对你有一定的参考价值。
一 RedHat7安装yum工具
1.1 查看yum是否可用
yum list
yum repolist
1.2 卸载原yum
rpm -aq|grep yum
rpm -aq|grep yum|xargs rpm -e --nodeps
1.3 下载centos源
wget -P /home/user/testyum https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget -P /home/user/testyum https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget -P /home/user/testyum https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget -P /home/user/testyum https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
cd /home/user/testyum
ls
1.4 安装centos源包
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
因为安装包之间存在相互依赖关系,四个源包按照顺序安装。
1.5 修改yum的repo配置文件
cd /etc/yum.repos.d/ ls mv redhat.repo redhat.repo.backup wget http://mirrors.163.com/.help/CentOS7-Base-163.repo vi CentOS7-Base-163.repo
修改变量-$releasever为7
1.6 清除原有yum缓存
yum clean all
1.7 建立新的yum缓存
yum makecache
以上是关于RedHat7安装yum工具的主要内容,如果未能解决你的问题,请参考以下文章