CentOS7更换yum阿里镜像源
- 备份系统自带的 yum 源配置文件
备份CentOS-Base.repo
sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
- 安装基本工具 wget
yum install -y wget
- 下载阿里yum源配置文件
wget -O /etc/yum.repos.d/CenOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
4. 清除旧缓存
yum clean all
- 创建新缓存
yum makecache
- 更新yum包软件索引
更新yum包软件索引,以后使用yum安装稍微会快一点
yum makecache fast
- 安装必要的软件包
yum -y install vim tree nmap sysstat gcc gcc-c++ make telnet
yum install yum-utils -y