Linux/CentOS

커널 삭제 방법

bong2. 2022. 6. 13. 07:45

하나의 OS에서 여러 버전의 커널이 설치된 경우가 있다. 

기 설치된 여러 커널 중 특정 커널을 삭제하기를 원할 때, 아래 명령어를 통해 삭제 가능하다.

1. 설치된 커널 확인 명령어

[root@localhost ~]# rpm -q kernel
kernel-3.10.0-693.el7.x86_64
kernel-3.10.0-693.82.1.el7.x86_64

2. 커널 삭제 명령어

[root@localhost ~]# yum remove -y kernel-3.10.0-693.el7.x86_64
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-693.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                              Arch                                                 Version                                                         Repository                                                   Size
=============================================================================================================================================================================================================================================
Removing:
 kernel                                               x86_64                                               3.10.0-693.el7                                                  @anaconda/7.4                                                59 M

Transaction Summary
=============================================================================================================================================================================================================================================
Remove  1 Package

Installed size: 59 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : kernel-3.10.0-693.el7.x86_64                                                                                                                                                                                              1/1
rhel-7-server-e4s-rpms/x86_64                                                                                                                                                                                         | 4.0 kB  00:00:00
rhel-7-server-eus-rpms/x86_64                                                                                                                                                                                         | 3.5 kB  00:00:00
rhel-7-server-rpms/x86_64                                                                                                                                                                                             | 3.4 kB  00:00:00
  Verifying  : kernel-3.10.0-693.el7.x86_64                                                                                                                                                                                              1/1

Removed:
  kernel.x86_64 0:3.10.0-693.el7

Complete!

 

만약, 현재 구동 중인 커널 버전 삭제 시에는 아래와 같은 메시지가 출력되며 삭제되지 않으니 사용 중인 커널 버전을 필히 확인 하길 바란다.

[root@localhost ~]# yum remove -y kernel-3.10.0-693.82.1.el7.x86_64
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Skipping the running kernel: kernel-3.10.0-693.82.1.el7.x86_64

3. 사용 중인 커널 버전 확인 명령어

[root@localhost ~]# uname -r
3.10.0-693.82.1.el7.x86_64