티스토리 뷰

CentOS 오래된 커널 정리

 

패키지 설치

###package-cleanup 명령어를 사용하기 위한 패키지
$ yum install -y yum-utils

 

커널 확인

###설치된 커널 확인
$ rpm -q kernel
kernel-4.14.186-146.268.amzn2.x86_64

 

사용 중인 커널 버전 확인

###현재 사용 중인 커널 버전
$ uname -r
4.14.186-146.268.amzn2.x86_64

 

yum.conf 설정(installonly_limit=2)

###자동으로 오래된 커널 삭제(기본 5에서 2로 변경 : installonly_limit=2)
$ cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=2
distroverpkg=system-release
timeout=5
retries=7

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

 

오래된 커널 삭제

###오래된 커널 삭제(2개만 남기고 나머지 삭제)
$ package-cleanup --oldkernels --count=2

 

 

댓글
댓글쓰기 폼