CentOS新环境
2021-12-22 本文已影响0人
taobao
新环境
# 更换阿里源
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