标签: centos7

  • CentOS7 关闭自带防火墙

    systemctl stop firewalld.service #停止firewall
    systemctl disable firewalld.service #禁止firewall开机启动
    firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
    
  • 更换CentOS7的yum源

    第一步

    进入yum源配置目录并备份系统自带的yum源

    cd /etc/yum.repos.d
    sudo mv CentOS-Base.repo CentOS-Base.repo.bak
    

    第二步

    下载需要替换的源

    阿里云:sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    163网易:wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
    中科大:wget http://centos.ustc.edu.cn/CentOS-Base.repo
    sohu:wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
    

    第三步

    执行下边命令更新yum配置,使操作立即生效

    yum clean all
    yum makecache