centos初始化脚本

#关闭防火墙和selinux:
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

#yum 源加速
#1. 获取wget工具
yum -y install wget
#2. 拉取镜像文件到 `/` 目录下
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
#3. 将centos中现有的yum的repo备份起来
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#4. 下载的国内yum的repo替换原本yum的repo
mv CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
#5. 重新生成缓存
yum clean all
yum makecache

#更新内核

yum update


#tab【补全】
yum -y install bash-completion && bash


#安装扩展源头
yum install -y epel-release

yum install net-tools -y

 

posted @   L北冥  阅读(41)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示