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

 

 

 由於安裝包之間存在相互依賴關係,四個源包按照順序安裝。node

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爲7python

 

 

 

1.6        清除原有yum緩存

yum clean all

 

1.7        創建新的yum緩存

yum makecache

 

 

相關文章
相關標籤/搜索