安装常用工具
yum install vim git net-tools wget gcc yum-utils device-mapper-persistent-data lvm2 -y
安装docker-ce
添加源信息
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
安装docker-ce
yum -y install docker-ce
设置开机启动
systemctl enable docker
启动docker
systemctl start docker
镜像加速
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://53qevzvm.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
重启docker
systemctl restart docker
升级内核
查看内核信息
uname -r
更新源
yum -y update
启用 ELRepo 仓库
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
查看可用的系统内核包
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
安装最新内核
yum --enablerepo=elrepo-kernel install kernel-ml
查看系统上所有可用内核
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
设置 grub2
sudo grub2-set-default 0
sed -i "s|GRUB_DEFAULT=saved|GRUB_DEFAULT=0|" /etc/default/grub
生成 grub 配置文件并重启
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
删除旧内核
查看系统所有内核包
rpm -qa | grep kernel
删除旧内核
yum remove kernel-3.10.0-1160.el7.x86_64 kernel-tools-3.10.0-1160.6.1.el7.x86_64 kernel-headers-3.10.0-1160.6.1.el7.x86_64 kernel-tools-libs-3.10.0-1160.6.1.el7.x86_64 kernel-3.10.0-1160.6.1.el7.x86_64
sudo reboot