2 expect 实现自动化 2018-04-09
一. 常用配置文件
hostname配置文件:/etc/sysconfig/network
ip配置文件:/etc/sysconfig/network-scripts/ifcfg-eth0
网络源配置文件:/etc/yum.repos.d/CentOS-Base.repo
二.修改网络源为阿里源
首先进入到/etc/yum.repos.d下,备份CentOS-Base.repo
mv CentOS-Base.repo CentOS-Base.repo.bak
下载阿里源文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
清理缓存
yum clean all
重新生成缓存
yum makecache
生成缓存时出现的错误:
错误原因是本地源配置文件中(CentOS-Media.repo),enabled=1,将其改为0即可
成功后结果如图:
再看CentOS-Base.repo中,出现aliyun: