删除最新(不是旧的)内核条目(升级) CentOS

删除最新(不是旧的)内核条目(升级) CentOS

我之前升级了我的 CentOS 安装...

在此输入图像描述

现在,我想删除一些以前的安装

[root@centos /]# ls -al /boot/loader/entries
total 36
drwx------. 2 root root 4096 Jun 13 10:32 .
drwxr-xr-x. 3 root root 4096 Jul  5  2020 ..
-rw-r--r--. 1 root root  395 Jul  5  2020 fb78af0a9247484aad9831a10a928084-0-rescue.conf
-rw-r--r--. 1 root root  358 Jun 11 11:36 fb78af0a9247484aad9831a10a928084-4.18.0-193.14.2.el8_2.x86_64.conf
-rw-r--r--. 1 root root  353 Jul  5  2020 fb78af0a9247484aad9831a10a928084-4.18.0-193.6.3.el8_2.x86_64.conf
-rw-r--r--. 1 root root  464 Jun 13 10:32 fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64.conf
-rw-r--r--. 1 root root  494 Jun 12 23:57 fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64.conf
-rw-r--r--. 1 root root  356 Jul 15  2020 fb78af0a9247484aad9831a10a928084-5.7.8-1.el8.elrepo.x86_64.conf
-rw-r--r--. 1 root root  356 Aug 11  2020 fb78af0a9247484aad9831a10a928084-5.8.0-1.el8.elrepo.x86_64.conf
[root@centos /]#

ls -al /lib/modules

[root@centos /]# ls -al /lib/modules
total 40
drwxr-xr-x. 10 root root 4096 Jun 11 13:56 .
dr-xr-xr-x. 46 root root 4096 Nov  3  2020 ..
drwxr-xr-x.  6 root root 4096 Jun 11 13:57 4.18.0-193.14.2.el8_2.x86_64
drwxr-xr-x.  6 root root 4096 Jun 11 13:57 4.18.0-193.6.3.el8_2.x86_64
drwxr-xr-x.  3 root root 4096 Jun 11 13:43 4.18.0-294.el8.x86_64
drwxr-xr-x.  7 root root 4096 Sep 10 07:41 4.18.0-305.3.1.el8.x86_64
drwxr-xr-x.  3 root root 4096 Jun 11 13:50 4.18.0-305.el8.x86_64
drwxr-xr-x.  6 root root 4096 Jun 11 13:57 5.12.10-1.el8.elrepo.x86_64
drwxr-xr-x.  7 root root 4096 Jun 11 13:57 5.7.8-1.el8.elrepo.x86_64
drwxr-xr-x.  6 root root 4096 Jun 11 13:58 5.8.0-1.el8.elrepo.x86_64
[root@centos /]# 

ls -al /boot

[root@centos /]# ls -al /boot
total 496740
dr-xr-xr-x.  7 root   root       4096 Jun 12 23:21  .
dr-xr-xr-x. 19 root   root       4096 Jun 20 10:32  ..
-rw-r--r--.  1 root   root     187644 Jul 25  2020  config-4.18.0-193.14.2.el8_2.x86_64
-rw-r--r--.  1 root   root     187643 Jun 10  2020  config-4.18.0-193.6.3.el8_2.x86_64
-rw-r--r--.  1 root   root     192095 Jun  1 11:22  config-4.18.0-305.3.1.el8.x86_64
-rw-r--r--.  1 root   root     209768 Jun  9 15:39  config-5.12.10-1.el8.elrepo.x86_64
-rw-r--r--.  1 root   root     197087 Jul  7  2020  config-5.7.8-1.el8.elrepo.x86_64
-rw-r--r--.  1 root   root     201589 Aug  2  2020  config-5.8.0-1.el8.elrepo.x86_64
drwx------.  4 root   root       4096 Dec 31  1969  efi
drwx------.  2 root   root       4096 Jun 13 11:31  grub2
-rw-------.  1 root   root   71713525 Jul  5  2020  initramfs-0-rescue-fb78af0a9247484aad9831a10a928084.img
-rw-------.  1 root   root   50305162 Jun 11 13:59  initramfs-4.18.0-193.14.2.el8_2.x86_64.img
-rw-------.  1 root   root   50307138 Jun 11 13:53  initramfs-4.18.0-193.6.3.el8_2.x86_64.img
-rw-------.  1 root   root   18642820 Jul  5  2020  initramfs-4.18.0-193.6.3.el8_2.x86_64kdump.img
-rw-------.  1 root   root   51341661 Jun 11 13:58  initramfs-4.18.0-305.3.1.el8.x86_64.img
-rw-------.  1 root   root   22841790 Jun 12 23:21  initramfs-4.18.0-305.3.1.el8.x86_64kdump.img
-rw-------.  1 root   root   51525393 Jun 11 13:51  initramfs-5.12.10-1.el8.elrepo.x86_64.img
-rw-------.  1 root   root   50966520 Jun 11 13:51  initramfs-5.7.8-1.el8.elrepo.x86_64.img
-rw-------.  1 root   root   50990920 Jun 11 13:51  initramfs-5.8.0-1.el8.elrepo.x86_64.img
drwxr-xr-x.  3 root   root       4096 Jul  5  2020  loader
drwx------.  2 root   root      16384 Jul  5  2020  lost+found
-rw-------.  1 root   root    3910607 Jul 25  2020  System.map-4.18.0-193.14.2.el8_2.x86_64
-rw-------.  1 root   root    3910484 Jun 10  2020  System.map-4.18.0-193.6.3.el8_2.x86_64
-rw-------.  1 root   root    4164308 Jun  1 11:22  System.map-4.18.0-305.3.1.el8.x86_64
-rw-------.  1 root   root    5019372 Jun  9 15:39  System.map-5.12.10-1.el8.elrepo.x86_64
-rw-------.  1 root   root    4654688 Jul  7  2020  System.map-5.7.8-1.el8.elrepo.x86_64
-rw-------.  1 root   root    4714527 Aug  2  2020  System.map-5.8.0-1.el8.elrepo.x86_64
drwxrwxrwx.  2 nobody nobody     4096 Sep  6  2020 'System Volume Information'
-rwxr-xr-x.  1 root   root    8106744 Jul  5  2020  vmlinuz-0-rescue-fb78af0a9247484aad9831a10a928084
-rwxr-xr-x.  1 root   root    8920200 Jul 25  2020  vmlinuz-4.18.0-193.14.2.el8_2.x86_64
-rw-r--r--.  1 root   root        173 Jul 25  2020  .vmlinuz-4.18.0-193.14.2.el8_2.x86_64.hmac
-rwxr-xr-x.  1 root   root    8913656 Jun 10  2020  vmlinuz-4.18.0-193.6.3.el8_2.x86_64
-rw-r--r--.  1 root   root        172 Jun 10  2020  .vmlinuz-4.18.0-193.6.3.el8_2.x86_64.hmac
-rwxr-xr-x.  1 root   root   10026120 Jun  1 11:22  vmlinuz-4.18.0-305.3.1.el8.x86_64
-rw-r--r--.  1 root   root        170 Jun  1 11:22  .vmlinuz-4.18.0-305.3.1.el8.x86_64.hmac
-rwxr-xr-x.  1 root   root    9099232 Jun  9 15:39  vmlinuz-5.12.10-1.el8.elrepo.x86_64
-rwxr-xr-x.  1 root   root    8558528 Jul  7  2020  vmlinuz-5.7.8-1.el8.elrepo.x86_64
-rwxr-xr-x.  1 root   root    8742176 Aug  2  2020  vmlinuz-5.8.0-1.el8.elrepo.x86_64
[root@centos /]#

为了删除我之前或特定升级/更新的文件的软件包/conf 的所有信息,我需要执行哪些步骤?

例如:我想要所有数据(不留痕迹)

[root@centos /]# cat /boot/loader/entries/fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64.conf
title Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)
version 5.12.10-1.el8.elrepo.x86_64
linux /vmlinuz-5.12.10-1.el8.elrepo.x86_64
initrd /initramfs-5.12.10-1.el8.elrepo.x86_64.img $tuned_initrd
options root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on
id rhel-20210609203943-5.12.10-1.el8.elrepo.x86_64
grub_users $grub_users
grub_arg --unrestricted
grub_class kernel
[root@centos /]# 

我想删除这些条目:

  • vmlinuz-5.12.10-1.el8.elrepo.x86_64
  • vmlinuz-5.7.8-1.el8.elrepo.x86_64
  • vmlinuz-5.8.0-1.el8.elrepo.x86_64

提前致谢!

检查这个帖子,只说删除老的 内核

我正在使用稳定的Kernel

[root@centos /]# uname -r
4.18.0-305.3.1.el8.x86_64
[root@centos /]# 

使用其他命令rpm -q kernel

[root@centos /]# rpm -q kernel
kernel-4.18.0-193.6.3.el8_2.x86_64
kernel-4.18.0-193.14.2.el8_2.x86_64
kernel-4.18.0-305.3.1.el8.x86_64
[root@centos /]#

使用其他命令rpm -q kernel-ml

[root@centos /]# rpm -q kernel-ml
kernel-ml-5.7.8-1.el8.elrepo.x86_64
kernel-ml-5.8.0-1.el8.elrepo.x86_64
kernel-ml-5.12.10-1.el8.elrepo.x86_64
[root@centos /]# 

[root@centos /]# cat /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
[root@centos /]# 

正如您所看到的,我不想删除旧的内核,或者删除最新的或最近的内核。

读这篇文章https://www.cyberciti.biz/faq/debian-redhat-linux-delete-kernel-command/

地位:

[root@centos /]# df -H
Filesystem       Size  Used Avail Use% Mounted on
devtmpfs         8.2G     0  8.2G   0% /dev
tmpfs            8.2G  260M  7.9G   4% /dev/shm
tmpfs            8.2G   11M  8.2G   1% /run
tmpfs            8.2G     0  8.2G   0% /sys/fs/cgroup
/dev/nvme0n1p9    34G  9.4G   23G  30% /
/dev/nvme0n1p7   1.1G  512M  442M  54% /boot
/dev/nvme0n1p10   26G   11G   13G  46% /var
/dev/nvme0n1p8   183G   73G  102G  42% /home
/dev/nvme0n1p6   1.1G  7.6M  1.1G   1% /boot/efi
/dev/loop0        66M   66M     0 100% /var/lib/snapd/snap/gtk-common-themes/1506
/dev/loop1        59M   59M     0 100% /var/lib/snapd/snap/core18/2074
/dev/loop2        32M   32M     0 100% /var/lib/snapd/snap/snapd/8542
/dev/loop3        58M   58M     0 100% /var/lib/snapd/snap/core18/1880
/dev/loop4        65M   65M     0 100% /var/lib/snapd/snap/core20/1081
/dev/loop5        34M   34M     0 100% /var/lib/snapd/snap/snapd/12398
/dev/loop6       102M  102M     0 100% /var/lib/snapd/snap/core/9665
/dev/loop7       105M  105M     0 100% /var/lib/snapd/snap/core/11316
/dev/loop8        69M   69M     0 100% /var/lib/snapd/snap/gtk-common-themes/1515
tmpfs            1.7G  8.4M  1.7G   1% /run/user/1000
[root@centos /]# 

具体来说

[root@centos /]# df -H /
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p9   34G  9.4G   23G  30% /
[root@centos /]#

使用此命令列出dnf list --installed kernel

[root@centos /]# dnf list --installed kernel
Installed Packages
kernel.x86_64                   4.18.0-193.6.3.el8_2                     @BaseOS
kernel.x86_64                   4.18.0-193.14.2.el8_2                    @BaseOS
kernel.x86_64                   4.18.0-305.3.1.el8                       @BaseOS
[root@centos /]#

使用此命令列出dnf list --installed kernel-ml

[root@centos /]# dnf list --installed kernel-ml
Installed Packages
kernel-ml.x86_64               5.7.8-1.el8.elrepo                  @elrepo-kernel
kernel-ml.x86_64               5.8.0-1.el8.elrepo                  @elrepo-kernel
kernel-ml.x86_64               5.12.10-1.el8.elrepo                @elrepo-kernel
[root@centos /]# 

或者

[root@centos /]# dnf list installed kernel-*
Installed Packages
kernel-core.x86_64                 4.18.0-193.6.3.el8_2            @BaseOS       
kernel-core.x86_64                 4.18.0-193.14.2.el8_2           @BaseOS       
kernel-core.x86_64                 4.18.0-305.3.1.el8              @BaseOS       
kernel-devel.x86_64                4.18.0-193.6.3.el8_2            @BaseOS       
kernel-devel.x86_64                4.18.0-193.14.2.el8_2           @BaseOS       
kernel-devel.x86_64                4.18.0-305.3.1.el8              @BaseOS       
kernel-headers.x86_64              4.18.0-305.3.1.el8              @BaseOS       
kernel-ml.x86_64                   5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml.x86_64                   5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml.x86_64                   5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-ml-core.x86_64              5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml-core.x86_64              5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml-core.x86_64              5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-ml-devel.x86_64             5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64           5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64           5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64           5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-modules.x86_64              4.18.0-193.6.3.el8_2            @BaseOS       
kernel-modules.x86_64              4.18.0-193.14.2.el8_2           @BaseOS       
kernel-modules.x86_64              4.18.0-305.3.1.el8              @BaseOS       
kernel-tools.x86_64                4.18.0-305.3.1.el8              @BaseOS       
kernel-tools-libs.x86_64           4.18.0-305.3.1.el8              @BaseOS       
[root@centos /]# 

我不确定这个解决方案 https://unix.stackexchange.com/a/600563/400726

谢谢

答案1

检查您当前使用的内核

uname -r

现在运行

dnf remove --oldinstallonly --setopt installonly_limit=1

检查要卸载的内核是否是您想要删除的内核。完成卸载后Grub会自动更新。只需重新启动即可完成。

答案2

列出包dnf list installed kernel*

[root@centos /]# dnf list installed kernel*
Installed Packages
kernel-core.x86_64                 4.18.0-193.6.3.el8_2            @BaseOS       
kernel-core.x86_64                 4.18.0-193.14.2.el8_2           @BaseOS       
kernel-core.x86_64                 4.18.0-305.3.1.el8              @BaseOS       
kernel-devel.x86_64                4.18.0-193.6.3.el8_2            @BaseOS       
kernel-devel.x86_64                4.18.0-193.14.2.el8_2           @BaseOS       
kernel-devel.x86_64                4.18.0-305.3.1.el8              @BaseOS       
kernel-headers.x86_64              4.18.0-305.3.1.el8              @BaseOS       
kernel-ml.x86_64                   5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml.x86_64                   5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml.x86_64                   5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-ml-core.x86_64              5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml-core.x86_64              5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml-core.x86_64              5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-ml-devel.x86_64             5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64           5.7.8-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64           5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64           5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-modules.x86_64              4.18.0-193.6.3.el8_2            @BaseOS       
kernel-modules.x86_64              4.18.0-193.14.2.el8_2           @BaseOS       
kernel-modules.x86_64              4.18.0-305.3.1.el8              @BaseOS       
kernel-tools.x86_64                4.18.0-305.3.1.el8              @BaseOS       
kernel-tools-libs.x86_64           4.18.0-305.3.1.el8              @BaseOS       
[root@centos /]# 

搜索内核包rpm -qa | grep kernel

[root@centos /]# rpm -qa | grep kernel
kernel-core-4.18.0-305.3.1.el8.x86_64
kernel-core-4.18.0-193.6.3.el8_2.x86_64
kernel-core-4.18.0-193.14.2.el8_2.x86_64
kernel-tools-libs-4.18.0-305.3.1.el8.x86_64
kernel-ml-core-5.12.10-1.el8.elrepo.x86_64
kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64
kernel-ml-5.12.10-1.el8.elrepo.x86_64
kernel-modules-4.18.0-193.6.3.el8_2.x86_64
kernel-ml-core-5.8.0-1.el8.elrepo.x86_64
kernel-ml-core-5.7.8-1.el8.elrepo.x86_64
kernel-4.18.0-193.14.2.el8_2.x86_64
kernel-devel-4.18.0-305.3.1.el8.x86_64
kernel-ml-5.8.0-1.el8.elrepo.x86_64
kernel-4.18.0-193.6.3.el8_2.x86_64
kernel-modules-4.18.0-193.14.2.el8_2.x86_64
kernel-devel-4.18.0-193.14.2.el8_2.x86_64
kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64
kernel-headers-4.18.0-305.3.1.el8.x86_64
kernel-4.18.0-305.3.1.el8.x86_64
kernel-tools-4.18.0-305.3.1.el8.x86_64
kernel-ml-5.7.8-1.el8.elrepo.x86_64
kernel-ml-modules-5.8.0-1.el8.elrepo.x86_64
kernel-modules-4.18.0-305.3.1.el8.x86_64
kernel-ml-modules-5.12.10-1.el8.elrepo.x86_64
kernel-devel-4.18.0-193.6.3.el8_2.x86_64

[root@centos /]#

对包进行分类以便查看包目标!

kernel-4.18.0-193.6.3.el8_2.x86_64
kernel-4.18.0-193.14.2.el8_2.x86_64
kernel-4.18.0-305.3.1.el8.x86_64
kernel-ml-5.7.8-1.el8.elrepo.x86_64
kernel-ml-5.8.0-1.el8.elrepo.x86_64
kernel-ml-5.12.10-1.el8.elrepo.x86_64

kernel-core-4.18.0-193.6.3.el8_2.x86_64
kernel-core-4.18.0-193.14.2.el8_2.x86_64
kernel-core-4.18.0-305.3.1.el8.x86_64
kernel-ml-core-5.7.8-1.el8.elrepo.x86_64
kernel-ml-core-5.8.0-1.el8.elrepo.x86_64
kernel-ml-core-5.12.10-1.el8.elrepo.x86_64

kernel-devel-4.18.0-193.14.2.el8_2.x86_64
kernel-devel-4.18.0-193.6.3.el8_2.x86_64
kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64

kernel-modules-4.18.0-193.6.3.el8_2.x86_64
kernel-modules-4.18.0-193.14.2.el8_2.x86_64
kernel-modules-4.18.0-305.3.1.el8.x86_64
kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64
kernel-ml-modules-5.8.0-1.el8.elrepo.x86_64
kernel-ml-modules-5.12.10-1.el8.elrepo.x86_64

kernel-tools-libs-4.18.0-305.3.1.el8.x86_64
kernel-headers-4.18.0-305.3.1.el8.x86_64
kernel-tools-4.18.0-305.3.1.el8.x86_64

如果我有兴趣删除5.7.8版本;我需要做类似的事情:

dnf remove kernel-ml-5.7.8-1.el8.elrepo.x86_64
dnf remove kernel-ml-core-5.7.8-1.el8.elrepo.x86_64
dnf remove kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64
dnf remove kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64

5.7.8快速选择需要删除的 相关包的方法:rpm -qa | grep ^kernel | grep 5\.7\.8

[root@centos /]# rpm -qa | grep ^kernel | grep 5\.7\.8
kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64
kernel-ml-core-5.7.8-1.el8.elrepo.x86_64
kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64
kernel-ml-5.7.8-1.el8.elrepo.x86_64
[root@centos /]# 

然后dnf remove $(rpm -qa | grep ^kernel | grep 5\.7\.8)将删除我需要的所有内容!

[root@centos /]# dnf remove $(rpm -qa | grep ^kernel | grep 5\.7\.8)
Dependencies resolved.
=================================================================================
 Package              Arch      Version                  Repository         Size
=================================================================================
Removing:
 kernel-ml            x86_64    5.7.8-1.el8.elrepo       @elrepo-kernel      0  
 kernel-ml-core       x86_64    5.7.8-1.el8.elrepo       @elrepo-kernel     64 M
 kernel-ml-devel      x86_64    5.7.8-1.el8.elrepo       @elrepo-kernel     50 M
 kernel-ml-modules    x86_64    5.7.8-1.el8.elrepo       @elrepo-kernel     23 M

Transaction Summary
=================================================================================
Remove  4 Packages

Freed space: 137 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                         1/1 
  Erasing          : kernel-ml-5.7.8-1.el8.elrepo.x86_64                     1/4 
  Erasing          : kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64               2/4 
  Erasing          : kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64             3/4 
  Running scriptlet: kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64             3/4 
  Running scriptlet: kernel-ml-core-5.7.8-1.el8.elrepo.x86_64                4/4 
  Erasing          : kernel-ml-core-5.7.8-1.el8.elrepo.x86_64                4/4 
warning: file /lib/modules/5.7.8-1.el8.elrepo.x86_64/updates: remove failed: No such file or directory

  Running scriptlet: kernel-ml-core-5.7.8-1.el8.elrepo.x86_64                4/4 
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-ml-5.12.10-1.el8.elrepo.x86_64.conf:6: hwcap directive ignored
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-ml-5.8.0-1.el8.elrepo.x86_64.conf:6: hwcap directive ignored

  Verifying        : kernel-ml-5.7.8-1.el8.elrepo.x86_64                     1/4 
  Verifying        : kernel-ml-core-5.7.8-1.el8.elrepo.x86_64                2/4 
  Verifying        : kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64               3/4 
  Verifying        : kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64             4/4 
Installed products updated.

Removed:
  kernel-ml-5.7.8-1.el8.elrepo.x86_64                                            
  kernel-ml-core-5.7.8-1.el8.elrepo.x86_64                                       
  kernel-ml-devel-5.7.8-1.el8.elrepo.x86_64                                      
  kernel-ml-modules-5.7.8-1.el8.elrepo.x86_64                                    

Complete!
[root@centos /]# 

就这样!

在此输入图像描述

我得到后:df -H /

[root@centos /]# df -H /
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p9   34G  9.2G   23G  29% /
[root@centos /]#

df -H

[root@centos /]# df -H
Filesystem       Size  Used Avail Use% Mounted on
devtmpfs         8.2G     0  8.2G   0% /dev
tmpfs            8.2G  529M  7.7G   7% /dev/shm
tmpfs            8.2G   11M  8.2G   1% /run
tmpfs            8.2G     0  8.2G   0% /sys/fs/cgroup
/dev/nvme0n1p9    34G  9.2G   23G  29% /
/dev/nvme0n1p7   1.1G  447M  506M  47% /boot
/dev/nvme0n1p8   183G   73G  102G  42% /home
/dev/nvme0n1p10   26G   11G   13G  46% /var
/dev/nvme0n1p6   1.1G  7.6M  1.1G   1% /boot/efi
/dev/loop1        59M   59M     0 100% /var/lib/snapd/snap/core18/2074
/dev/loop0       102M  102M     0 100% /var/lib/snapd/snap/core/9665
/dev/loop2        66M   66M     0 100% /var/lib/snapd/snap/gtk-common-themes/1506
/dev/loop3        32M   32M     0 100% /var/lib/snapd/snap/snapd/8542
/dev/loop4        58M   58M     0 100% /var/lib/snapd/snap/core18/1880
/dev/loop5        34M   34M     0 100% /var/lib/snapd/snap/snapd/12398
/dev/loop7       105M  105M     0 100% /var/lib/snapd/snap/core/11316
/dev/loop6        65M   65M     0 100% /var/lib/snapd/snap/core20/1081
/dev/loop8        69M   69M     0 100% /var/lib/snapd/snap/gtk-common-themes/1515
tmpfs            1.7G   11M  1.7G   1% /run/user/1000
[root@centos /]# 

最后dnf list installed kernel*

[root@centos /]# dnf list installed kernel*
Installed Packages
kernel.x86_64                     4.18.0-193.6.3.el8_2            @BaseOS       
kernel.x86_64                     4.18.0-193.14.2.el8_2           @BaseOS       
kernel.x86_64                     4.18.0-305.3.1.el8              @BaseOS       
kernel-core.x86_64                4.18.0-193.6.3.el8_2            @BaseOS       
kernel-core.x86_64                4.18.0-193.14.2.el8_2           @BaseOS       
kernel-core.x86_64                4.18.0-305.3.1.el8              @BaseOS       
kernel-devel.x86_64               4.18.0-193.6.3.el8_2            @BaseOS       
kernel-devel.x86_64               4.18.0-193.14.2.el8_2           @BaseOS       
kernel-devel.x86_64               4.18.0-305.3.1.el8              @BaseOS       
kernel-headers.x86_64             4.18.0-305.3.1.el8              @BaseOS       
kernel-ml.x86_64                  5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml.x86_64                  5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-ml-core.x86_64             5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml-core.x86_64             5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-ml-modules.x86_64          5.8.0-1.el8.elrepo              @elrepo-kernel
kernel-ml-modules.x86_64          5.12.10-1.el8.elrepo            @elrepo-kernel
kernel-modules.x86_64             4.18.0-193.6.3.el8_2            @BaseOS       
kernel-modules.x86_64             4.18.0-193.14.2.el8_2           @BaseOS       
kernel-modules.x86_64             4.18.0-305.3.1.el8              @BaseOS       
kernel-tools.x86_64               4.18.0-305.3.1.el8              @BaseOS       
kernel-tools-libs.x86_64          4.18.0-305.3.1.el8              @BaseOS       
[root@centos /]# 

rpm -qa | grep kernel

[root@centos /]# rpm -qa | grep kernel
kernel-core-4.18.0-305.3.1.el8.x86_64
kernel-core-4.18.0-193.6.3.el8_2.x86_64
kernel-core-4.18.0-193.14.2.el8_2.x86_64
kernel-tools-libs-4.18.0-305.3.1.el8.x86_64
kernel-ml-core-5.12.10-1.el8.elrepo.x86_64
kernel-ml-5.12.10-1.el8.elrepo.x86_64
kernel-modules-4.18.0-193.6.3.el8_2.x86_64
kernel-ml-core-5.8.0-1.el8.elrepo.x86_64
kernel-4.18.0-193.14.2.el8_2.x86_64
kernel-devel-4.18.0-305.3.1.el8.x86_64
kernel-ml-5.8.0-1.el8.elrepo.x86_64
kernel-4.18.0-193.6.3.el8_2.x86_64
kernel-modules-4.18.0-193.14.2.el8_2.x86_64
kernel-devel-4.18.0-193.14.2.el8_2.x86_64
kernel-headers-4.18.0-305.3.1.el8.x86_64
kernel-4.18.0-305.3.1.el8.x86_64
kernel-tools-4.18.0-305.3.1.el8.x86_64
kernel-ml-modules-5.8.0-1.el8.elrepo.x86_64
kernel-modules-4.18.0-305.3.1.el8.x86_64
kernel-ml-modules-5.12.10-1.el8.elrepo.x86_64
kernel-devel-4.18.0-193.6.3.el8_2.x86_64
[root@centos /]# 

相关内容