Computer System/Linux

[Linux] CentOS 7 에서 최신 mainline 커널, long term 커널 설치 방법 (CentOS 7.3)

해리팍 2018. 4. 2. 11:39
반응형

안녕하세요.


CentOS 7 에서 커널 컴파일 없이 최신 mainline 커널, 혹은 long term 커널을 설치하는 방법입니다.


다음의 명령어로 간단하게 설치 가능합니다.


* CentOS 6 에서 커널 업데이트 - http://harryp.tistory.com/668


1. Repository 추가


# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org


 # rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm


두번째 명렁어의 볼드체로 표시한 부분 ('7.0-3')을 사용하시는 CentOS 버전에 맞추어주시면 됩니다.


저는 CentOS 7.3을 사용하고 있어 '7.0-3' 로 입력하였습니다.



2-1. Mainline 커널 설치


# yum --enablerepo=elrepo-kernel install kernel-ml 


2-2. Long term 커널 설치


# yum --enablerepo=elrepo-kernel install kernel-lt




위 명령어로 커널 설치 후 grub 설정을 변경해주고, 리부팅을 한 후 'uname -a' 명령어로 확인해보면 


최신 커널이 정상적으로 설치 되있는 것을 확인 가능합니다.



* grub 설정 수정


CentOS 7 부터는 grub2를 사용하고 있습니다.


다음의 방법을 통해 부팅 순서를 변경 가능합니다.



1. 부팅 가능한 커널 확인


다음 명령어를 통해 확인 가능합니다.


# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2

CentOS Linux (4.4.126-1.el7.elrepo.x86_64) 7 (Core)

CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)

CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)

CentOS Linux (0-rescue-56f261cb5ffb4cd79e91b06aa35f756c) 7 (Core)


총 4개의 커널로 부팅이 가능합니다.


저는 제일 위의 커널로 설정해보겠습니다.



2. grub2 설정


다음 명령어를 통해 설정 가능합니다.


 # grub2-set-default "CentOS Linux (4.4.126-1.el7.elrepo.x86_64) 7 (Core)"



3. 설정 확인


다음 명령어를 통해 확인 가능합니다.


# grub2-editenv list

saved_entry=CentOS Linux (4.4.126-1.el7.elrepo.x86_64) 7 (Core)



4. 리부팅


reboot 명령어로 리부팅 해주면 바뀐 커널로 부팅 가능합니다.

반응형