Docker 学习002 centos初始化配置

1.查看centos版本

cat /etc/centos-release

2.下载安装wget

yum install -y wget

3.备份默认yum

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

4.设置新的yum目录

mkdir -p /etc/yum.repos.d


5.下载阿里云yum配置到该目录,选择对应的版本

wget -o /etc/yum.repos.d/Centos-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

6.更新epel源为阿里云的epel

切换到yum所在的目录

cd /etc/yum.repos.d

原来的yum备份

mv Centos-Base.repo Centos-Base.repo.bak

使用wget获取阿里云源

wget http://mirrors.aliyun.com/repo/Centos-7.repo

阿里云源改名为原文件名

mv Centos-7.repo CentOS-Base.repo

修改epel源

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

重新加载yum

yum clean all
yum makecache

7.重启后linux版本升级了

8.查看cpu状态

lscpu

9.内核信息

uanme -r

uname-a 详细

10.内存空间

free -h

12.系统空间

fdisk

13.关闭防火墙

systemctl stop firewalld      关闭防火墙
systemctl disable firewalld   开机不启动

14.设置selinux关闭

sed -i 's/SELINUX=enforcing/SLINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0

15.网桥过滤

vi /etc/sysctl.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-arptables = 1
net.ipv4.ip_forward=1
net.ipv4.ip_forward_use_pmtu=0

生效命令

sysctl --system

16.快速开发:

命令补全

安装:

yum -y install bash-completion bash-completion-extras

使用:

source /etc/profile.d/bash_completion.sh

17.上传文件

yum -y install lrzsz

rz  / 拖拽  上传文件

sz  下载文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值