1、安装wget
yum install wget -y 安装wget工具
2、配置本机的yum源为阿里云镜像源和epel源
cd /etc/yum.repos.d/ 找到官方yum源存放的位置
mkdir backup 创建一个backup的文件夹用备份存放官方yum源
mv *.repo ./backup/ 将当前目录下得后缀为 .repo文件移动到backup文件夹中
阿里云镜像源网址:centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
确保在/etc/yum.repos.d文件夹下
执行:wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
ls命令查看是否有这个源
3、重新加载yum源
yum clean all 清理yum缓存
yum makecache 重新加载yum缓存
4、到这里更新yum源和eple源为阿里云的,就结束了!!!
5、关闭selinux
vi /etc/selinux/config
6、优化系统(安装基本的插件)
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel net-tools vim -y