Translated message

A translation of this page exists in English.

Red Hat Enterprise linux systems에서 특정 개수의 kernel packages를 유지하는 방법은 무엇입니까?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 5, 6, 7, 8, 9, 10

Issue

  • system에서 특정 개수의 kernel packages를 유지할 때 installonly_limit option의 용도는 무엇입니까?
  • grub에 표시되는 kernel의 개수를 변경하는 방법은 무엇입니까?
  • grub에 표시되는 kernel의 개수를 늘리는 방법은 무엇입니까?
  • grub에 표시되는 kernel의 개수를 줄이는 방법은 무엇입니까?

Resolution

/etc/yum.confinstallonly_limit option은 system에 유지할 kernel packages의 개수를 관리하는 데 사용됩니다.

예를 들어, 다음 parameter는 system에 3개의 kernel packages를 유지합니다. 해당 개수에 도달하면 가장 오래된 kernel이 제거됩니다.

# cat /etc/yum.conf
[main]
installonly_limit=3

installonly_limit=2를 사용하면 하나의 backup kernel을 사용할 수 있습니다.

installonly_limit=1로 설정할 수 없습니다. 그렇게 하면 yum이 현재 실행 중인 kernel을 제거하게 되며, 이는 금지되어 있기 때문입니다. installonly_limit=1이 사용되면 yum이 실패합니다.

server에 이미 3개의 kernel versions가 설치되어 있는 경우, installonly_limit=2로 구성하고 최신 kernel을 다시 설치(또는 업그레이드)하면,
가장 오래전에 설치된 kernel이 자동으로 제거되어 가장 최신의 2개 kernel versions만 유지되도록 보장합니다.

예를 들어,

# rpm -qa | grep -i kernel-core
kernel-core-5.14.0-284.11.1.el9_2.x86_64
kernel-core-5.14.0-503.40.1.el9_5.x86_64
kernel-core-5.14.0-611.16.1.el9_7.x86_64

# grep install /etc/dnf/dnf.conf 
installonly_limit=2

# dnf reinstall kernel-core-5.14.0-611.16.1.el9_7.x86_64
Updating Subscription Management repositories.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)                                                                                                                               5.1 MB/s | 103 MB     00:20    
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)                                                                                                                            16 MB/s |  83 MB     00:05    
Dependencies resolved.
=======================================================================================================================================
Package                     Architecture                     Version                 Repository                             Size
=======================================================================================================================================
Reinstalling:
 kernel-core                     x86_64                 5.14.0-611.16.1.el9_7       rhel-9-for-x86_64-baseos-rpms              17 M
Installing dependencies:
 kernel-uki-virt                 x86_64                 5.14.0-284.11.1.el9_2       rhel-9-for-x86_64-baseos-rpms              54 M
Removing:
 kernel                          x86_64                 5.14.0-284.11.1.el9_2       @anaconda                                   0  
 kernel-core                     x86_64                 5.14.0-284.11.1.el9_2       @anaconda                                  56 M
 kernel-devel                    x86_64                 5.14.0-284.11.1.el9_2       @AppStream                                 63 M

Transaction Summary
=======================================================================================================================================
Install  1 Package
Remove   3 Packages

Total download size: 71 M
Is this ok [y/N]: n
Operation aborted.

Note: RHEL 8+의 경우 /etc/yum.conf/etc/dnf/dnf.conf에 대한 symlink인지 확인하십시오. 그렇지 않으면 /etc/yum.conf에 수행한 편집 내용이 적용되지 않습니다.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments