美文网首页
CentOS新环境

CentOS新环境

作者: taobao | 来源:发表于2021-12-22 15:23 被阅读0次

    新环境

    # 更换阿里源
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
    wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
    yum clean all && yum makecache
    
    # 更新
    yum update -y
    
    # 安装git
    yum install -y git 
    
    # 安装docker
    yum install -y yum-utils device-mapper-persistent-data lvm2
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum install -y docker-ce
    systemctl start docker && systemctl enable docker
    
    # 开启ipv4转发
    echo 'net.ipv4.ip_forward=1'  >> /etc/sysctl.conf
    
    # 设置时区
    timedatectl set-timezone Asia/Shanghai
    
    # 安装epel源
    yum install -y epel-release
    

    shell

    #!/bin/bash
    
    # 更换阿里源
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
    wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
    yum clean all && yum makecache
    
    # 更新
    yum update -y
    
    # 安装git
    yum install -y git 
    
    # 安装docker
    yum install -y yum-utils device-mapper-persistent-data lvm2
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum install -y docker-ce
    systemctl start docker && systemctl enable docker
    
    # 开启转发
    echo 'net.ipv4.ip_forward=1'  >> /etc/sysctl.conf
    

    相关文章

      网友评论

          本文标题:CentOS新环境

          本文链接:https://www.haomeiwen.com/subject/zbkqqrtx.html