CentOs7 yum 卸载与安装
以下内容是当应用 yum 安装时报错时的解决一种方式
1、查看yum安装包
# rpm -qa | grep yum
2、将其全部卸载(XXXXX指你那边的文件名)
#rpm -e yum-XXXXX --nodeps
#rpm -e yum-XXXXX --nodeps
#rpm -e yum-XXXXX --nodeps
#rpm -e yum-XXXXX --nodeps
3、在http://mirrors.163.com/centos/7/os/x86_64/Packages/下载如下20个包
libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm
python-ipaddress-1.0.16-2.el7.noarch.rpm
lvm2-python-libs-2.02.185-2.el7.x86_64.rpm
python-kitchen-1.1.1-5.el7.noarch.rpm
yum-3.4.3-163.el7.centos.noarch.rpm
python-2.7.5-86.el7.x86_64.rpm
python-libs-2.7.5-86.el7.x86_64.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
python-pycurl-7.19.0-19.el7.x86_64.rpm
yum-plugin-aliases-1.1.31-52.el7.noarch.rpm
python-chardet-2.2.1-3.el7.noarch.rpm
python-setuptools-0.9.8-7.el7.noarch.rpm
yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm
python-devel-2.7.5-86.el7.x86_64.rpm
python-urlgrabber-3.10-9.el7.noarch.rpm
yum-plugin-protectbase-1.1.31-52.el7.noarch.rpm
python-iniparse-0.4-9.el7.noarch.rpm
rpm-python-4.11.3-40.el7.x86_64.rpm
yum-utils-1.1.31-52.el7.noarch.rpm
4、下载完成后执行
#rpm -Uvh --replacepkgs lvm2-python-libs*.rpm --nodeps --force
#rpm -Uvh --replacepkgs libxml2-python*.rpm --nodeps --force
#rpm -Uvh --replacepkgs python*.rpm --nodeps --force
#rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm --nodeps --force
5、成功安装
#yum -v
6、修改yum源
下载:http://mirrors.163.com/.help/CentOS7-Base-163.repo
将源移动到yum源上传到 /etc/yum.repos.d/ 目录下
运行makecache 生成缓存
# yum makecache
运行yum clean all
# yum clean all
更新
# yum update
参考博客链接 yum安装卸载:https://www.cnblogs.com/xdjun/p/11770418.html
参考博客链接 yum 源修改:https://blog.csdn.net/yuang01/article/details/85066626