LinuxYUM重新安装

清除所有yum文件
#rpm -aq|grep yum|xargs rpm -e --nodeps

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-libs-2.7.5-76.el7.x86_64.rpm      1
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-2.7.5-76.el7.x86_64.rpm         1
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm    
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm  

          
#rpm -ivh *.rpm

#wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
#wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
#wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

#rpm --nodeps --force -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

#yum -V

#cd  /etc/yum.repos.d

#wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

将文件中的$releasever替換成7 (7是指LINUX版本號), 下面是本人改了之后的截图

运行makecache 生成缓存

#yum makecache

运行yum clean all


#yum clean all

更新yum文件(等待时间有点长)

yum update

---------------------------------------------------------------------------------------------

如果以上不行. 快照linux镜像, 将系统盘初始化.将之前的镜像创建以镜像创建云盘

之后将云盘挂载.

取出之前的数据即可

 

 

你可能感兴趣的:(LINUX,YUM)