1. 查看系统版本
[root@ganluren-wk
~]# cat /etc/redhat-release
2.安装epel源
[root@ganluren-wk
~]# yum -y install epel-release
3.安装rpmconf软件包
[root@ganluren-wk
~]# yum -y install rpmconf
4. 使用rpmconf命令检查所有软件包的配置文件:
[root@ganluren-wk
~]# rpmconf –a
5.清理不需要的rpm 包
[root@ganluren-wk ~]# package-cleanup --leaves
[root@ganluren-wk
~]# package-cleanup --orphans
6. 安装CentOS 8默认包管理器dnf
[root@ganluren-wk
~]# yum -y install dnf
7.删除Centos7默认包管理器yum
[root@ganluren-wk
~]# dnf -y remove yum
yum-metadata-parser
[root@ganluren-wk ~]# rm -rf /etc/yum
8.升级系统
[root@ganluren-wk
~]# dnf upgrade
9. 安装Centos8.5 发行包
[root@ganluren-wk~]# dnf install https://mirrors.aliyun.com/centos/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}
10.升级epel 源
[root@ganluren-wk~]# dnf upgrade https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
11.查看系统版本
[root@ganluren-wk ~]# cat /etc/redhat-release
12 升级内核版本,查看内核版本
[root@ganluren-wk
~]# cat /proc/version
13.添加elrepo存储库
[root@ganluren-wk~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
14. 导入GPG密钥
[root@ganluren-wk~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
15. 安装linux kernel
查询资源库中可用的内核版本
[root@ganluren-wk
~]# dnf --enablerepo="elrepo-kernel" list --showduplicates | sort -r
| grep kernel-ml.x86_64
选择 ML 或 LT 版本安装
安装 ML 版本
[root@ganluren-wk ~]# dnf --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml –y
安装 LT 版本,K8S全部选这个
yum
--enablerepo=elrepo-kernel install kernel-lt-devel kernel-lt –y
16. 查看现有内核启动顺序
[root@ganluren-wk
~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
17. 修改默认启动项
xxx 为序号数字,以指定启动列表中第x项为启动项,x从0开始计数 下次启动从6.2.11启动
[root@ganluren-wk ~]# grub2-set-default 0
18.重启,检查内核版本
[root@ganluren-wk ~]# reboot
[root@ganluren-wk
~]# cat /proc/version
19. 删除低版本内核
查询系统中全部内核
[root@ganluren-wk
~]# rpm -qa | grep kernel
删除内核
[root@ganluren-wk ~]# dnf remove -y kernel-3.10.0-1160.88.1.el7.x86_64
[root@ganluren-wk
~]# dnf remove -y kernel-3.10.0-1160.el7.x86_64
查看内核启动顺序