首先把selinux给禁用掉,不禁用有时候会各种各样的错误
查看
[root@localhost ~]# getenforce Enforcing
永久关闭
[root@localhost ~]# vi /etc/selinux/config
修改
SELINUX=disabled
设置后需要重启才能生效
[root@localhost ~]# reboot
备份
[root@localhost~]# yum install wget [root@localhost~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# mkdir repo_bak [root@localhost yum.repos.d]# mv *.repo repo_bak/ [root@localhost yum.repos.d]# ls repo_bak
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# yum -y install yum-utils
[root@localhost ~]# yum install wget
之后运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存
[root@localhost yum.repos.d]# yum clean all [root@localhost yum.repos.d]# yum makecache