本帖最后由 八哥 于 2023-10-29 12:40 编辑
备份
- mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
复制代码
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
- centos-6
- curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
- centos-7
- curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 腾讯云
- wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
复制代码
生成缓存并更新系统
- yum clean all
- yum makecache
- yum list updates
- yum -y update(更新内核)
- 或
- yum -y upgrade(不更新内核)
复制代码
|