centos7配置镜像源(阿里)

配置centos镜像源整理
1 备份原文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak

2 下载阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3 建立cache
yum clean all
yum makecache

4 升级更新源包
yum -y update #升级所有包同时也升级软件和系统内核
yum -y upgrade #只升级所有包,不升级软件和系统内核

5 更新epel源
yum install epel-release -y

wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

yum clean all # 清除系统所有的yum缓存
yum makecache # 生成yum缓存

posted @ 2021-05-25 11:12  小马搬砖  阅读(508)  评论(0)    收藏  举报