编辑2

编辑2

目前,当我uname -msr在 CentOS 7 机器上运行时,我得到

Linux 5.15.0 x86_64

但是,我在类似的帖子中读到过,内核版本应为3.10.xxxx。这一点从维基百科上也能得到证实。

我已经运行yum install kernel-devel并在我的/usr/src/kernels/目录中,我看到

$ ls /usr/src/kernels/
3.10.0-1160.88.1.el7.x86_64  3.10.0-1160.88.1.el7.x86_64.debug  3.10.0-693.el7.x86_64

所以我的问题是为什么 uname -r 显示的内容与 centos 支持的内核版本不同?这里有什么区别呢。

CentOS 版本

$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

编辑

$ rpm -qa | grep kernel
kernel-devel-3.10.0-1160.88.1.el7.x86_64
kernel-ml-6.2.10-1.el7.elrepo.x86_64
kernel-3.10.0-1160.88.1.el7.x86_64
kernel-tools-3.10.0-1160.88.1.el7.x86_64
kernel-debug-devel-3.10.0-1160.88.1.el7.x86_64
kernel-tools-libs-3.10.0-1160.88.1.el7.x86_64
kernel-headers-3.10.0-1160.88.1.el7.x86_64
kernel-3.10.0-693.el7.x86_64
$ yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.tuna.tsinghua.edu.cn
 * centos-sclo-rh: mirrors.tuna.tsinghua.edu.cn
 * centos-sclo-sclo: mirrors.tuna.tsinghua.edu.cn
 * elrepo: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
repo id                             repo name                                                        status
base/7/x86_64                       CentOS-7 - Base                                                  10,072
centos-sclo-rh/x86_64               CentOS-7 - SCLo rh                                                8,170
centos-sclo-sclo/x86_64             CentOS-7 - SCLo sclo                                                816
docker-ce-stable/7/x86_64           Docker CE Stable - x86_64                                           223
elrepo                              ELRepo.org Community Enterprise Linux Repository - el7              146
extras/7/x86_64                     CentOS-7 - Extras                                                   515
updates/7/x86_64                    CentOS-7 - Updates      

编辑2

$ ls -l /lib/modules /boot
/boot:
total 373616
-rw-r--r--. 1 root root    153619 Mar  7 23:46 config-3.10.0-1160.88.1.el7.x86_64
-rw-r--r--. 1 root root    140894 Aug 23  2017 config-3.10.0-693.el7.x86_64
-rw-r--r--. 1 root root    243280 Apr  5 02:17 config-6.2.10-1.el7.elrepo.x86_64
drwx------. 3 root root     16384 Jan  1  1970 efi
drwxr-xr-x. 2 root root        27 Sep 10  2020 grub
drwx------. 2 root root        21 Apr 10 23:11 grub2
-rw-------. 1 root root  51335016 Sep 10  2020 initramfs-0-rescue-2dce683a368f4627b753b7f4fb98e25b.img
-rw-------. 1 root root  22665935 Apr 10 23:16 initramfs-3.10.0-1160.88.1.el7.x86_64.img
-rw-------. 1 root root  22125539 Apr 10 23:17 initramfs-3.10.0-693.el7.x86_64.img
-rw-------. 1 root root  18774483 Sep 10  2020 initramfs-3.10.0-693.el7.x86_64kdump.img
-rw-------. 1 root root  41979536 Oct 16  2020 initramfs-4.9.0-dockrdma.img
-rw-------. 1 root root 131834625 Mar 27 14:44 initramfs-5.15.0.img
-rw-------. 1 root root  25586671 Apr 11 10:22 initramfs-6.2.10-1.el7.elrepo.x86_64.img
-rw-r--r--. 1 root root    611343 Sep 10  2020 initrd-plymouth.img
-rw-r--r--. 1 root root    320760 Mar  7 23:46 symvers-3.10.0-1160.88.1.el7.x86_64.gz
-rw-r--r--. 1 root root    293027 Aug 23  2017 symvers-3.10.0-693.el7.x86_64.gz
-rw-r--r--. 1 root root    325156 Apr  5 02:19 symvers-6.2.10-1.el7.elrepo.x86_64.gz
lrwxrwxrwx. 1 root root        23 Mar 27 14:42 System.map -> /boot/System.map-5.15.0
-rw-------. 1 root root   3623956 Mar  7 23:46 System.map-3.10.0-1160.88.1.el7.x86_64
-rw-------. 1 root root   3228420 Aug 23  2017 System.map-3.10.0-693.el7.x86_64
-rw-r--r--. 1 root root   3546452 Oct 16  2020 System.map-4.9.0-dockrdma
-rw-r--r--. 1 root root   4773612 Mar 27 14:42 System.map-5.15.0
-rw-------. 1 root root   6451480 Apr  5 02:17 System.map-6.2.10-1.el7.elrepo.x86_64
lrwxrwxrwx. 1 root root        20 Mar 27 14:42 vmlinuz -> /boot/vmlinuz-5.15.0
-rwxr-xr-x. 1 root root   5877760 Sep 10  2020 vmlinuz-0-rescue-2dce683a368f4627b753b7f4fb98e25b
-rwxr-xr-x. 1 root root   7051880 Mar  7 23:46 vmlinuz-3.10.0-1160.88.1.el7.x86_64
-rwxr-xr-x. 1 root root   5877760 Aug 23  2017 vmlinuz-3.10.0-693.el7.x86_64
-rw-r--r--. 1 root root   6261632 Oct 16  2020 vmlinuz-4.9.0-dockrdma
-rw-r--r--. 1 root root   8679392 Mar 27 14:42 vmlinuz-5.15.0
-rwxr-xr-x. 1 root root  10762144 Apr  5 02:17 vmlinuz-6.2.10-1.el7.elrepo.x86_64

/lib/modules:
total 20
drwxr-xr-x. 7 root root 4096 Apr 10 23:16 3.10.0-1160.88.1.el7.x86_64
drwxr-xr-x. 7 root root 4096 Nov 20  2020 3.10.0-693.el7.x86_64
drwxr-xr-x. 3 root root 4096 Oct 16  2020 4.9.0-dockrdma
drwxr-xr-x. 4 root root 4096 Mar 27 14:56 5.15.0
drwxr-xr-x. 7 root root 4096 Apr 11 10:22 6.2.10-1.el7.elrepo.x86_64

相关内容