Centos更新Yum源
原创
©著作权归作者所有:来自51CTO博客作者You0tech的原创作品,谢绝转载,否则将追究法律责任
备份本地yum源:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak;
下载阿里云yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo;
或
curl -o /etc/yum.repos.d/CentOS-Bash.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo;
清理缓存
更新cache
查看更新
关闭selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
reboot (重启方可永久生效)
配置时间同步
yum install -y ntp ntpdate
ntpdate cn.pool.ntp.org
配置时间同步定时任务
crontab -e
* */1 * * * /usr/sbin/ntpdate cn.pool.ntp.org (每一个小时,同步一次)
systemctl restart crond (重启下定时认为进程)
安装依赖
yum install -y wget net-tools nfs-utils lrzsz gcc gcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntp libaio-devel wget vim ncurses-devel autoconf automake zlib-devel python-devel epel-release openssh-server socat ipvsadm conntrack yum-utils