centos 6.5カーネルアップグレード

4693 ワード

今日はcentosで6.5 dockerをインストールして、ネットでcentos 6を調べました.5は64ビット、カーネルは3にアップグレードする必要があります.x以上(centos 6.5は本来2.6)
elrepoについて
ElrepoはCentOSにとって非常に有用な安定したソフトウェアソースであり、他のソフトウェアソースとは異なり、このサードパーティソースは主にハードウェア駆動、カーネル更新のサポート、例えばグラフィックスカード、ワイヤレスカード、カーネルなどを提供し、現在centos 7をサポートしている.x+、更新が早い.
1、centosバージョンの表示
[root@localhost ~]# cat /etc/centos-release 
CentOS release 6.4 (Final)

2、カーネルの表示
[root@localhost ~]# uname -r
2.6.32-358.el6.x86_64

3、まず最初にやるべきことはpublic keyを導入することです
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

4、その後ELRepoをCentOS-6にインストール.x中 elrepo-release-6-6.el6.elrepo.noarch.rpmこれはcentos 6に対するものである.0+バージョンで、パッケージが見つからない場合は
http://www.elrepo.org        : 
1、インストールELRepo for RHEL-6, SL-6 or CentOS-6:
rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

2、取付ELRepo for RHEL-7, SL-7 or CentOS-7:
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm (external link)

3、取付ELRepo for RHEL-5, SL-5 or CentOS-5:
rpm -Uvh http://www.elrepo.org/elrepo-release-5-5.el5.elrepo.noarch.rpm (external link)

インストールを実行します.
[root@localhost ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

戻り値:
Retrieving http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
Preparing...                ########################################### [100%]
   1:elrepo-release         ########################################### [100%]

5、kernel-lt(lt=long-term)を取り付ける
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt -y

....................
Installed:
  kernel-lt.x86_64 0:4.4.139-1.el6.elrepo                                                                                                                                                                                     
Complete!
または取り付けkernel-ml(ml=mainline)
yum --enablerepo=elrepo-kernel install kernel-ml -y

どちらかを選ぶ!
6、grubを編集する.confファイル、Grubブート順の変更
vim /etc/grub.conf
iを押してdefault=1default=0に変更し、escキーを押して、:wq保存終了を入力します.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.28-1.el6.elrepo.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8
 rd_NO_LVM rd_NO_DM rhgb quiet
        initrd /boot/initramfs-3.10.28-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-431.3.1.el6.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8 r
d_NO_LVM rd_NO_DM rhgb quiet
        initrd /boot/initramfs-2.6.32-431.3.1.el6.x86_64.img
title CentOS (2.6.32-431.el6.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO
_LVM rd_NO_DM rhgb quiet
        initrd /boot/initramfs-2.6.32-431.el6.x86_64.img

注意:
インストールしたばかりのカーネルがどの位置にあるかを確認し、default値(0から)を設定します.通常、新しくインストールしたカーネルは最初の位置にあるので、default=0を設定します.
7、centosを再起動する
[root@localhost ~]# reboot

8、カーネルの再表示
[root@localhost ~]# uname -r
3.10.103-1.el6.elrepo.x86_64

アップグレード成功!