本文轉載自:http://ljf.me/ docker
網上有很多升級CentOS內核的文章,如《CentOS 6.5 升級內核到 3.10.28》,大部分都是下載源碼編譯,有點麻煩。shell
在yum的ELRepo源中,有mainline(3.13.1)、long-term(3.10.28)這2個內核版本,考慮到long-term更穩定,會長期更新,因此選擇這個版本。vim
一、導入public keycentos
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
二、安裝ELRepo到CentOS-6.5中ui
rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
三、安裝**kernel-lt(lt=long-term)**this
yum --enablerepo=elrepo-kernel install kernel-lt -y
或者安裝kernel-ml(ml=mainline)spa
yum --enablerepo=elrepo-kernel install kernel-ml -y
四、編輯grub.conf文件,修改Grub引導順序code
vim /etc/grub.conf
# 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.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.UTF-8 rd_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.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。 五、重啓,查看內核版本號orm
[root@dev ~]# uname -r 3.10.28-1.el6.elrepo.x86_64
如下本身添加:blog
----------------centos6.5 安裝 docker-----------------------------
運行docker Linux內核版本須要在3.8以上.(個人centos在沒升級到3.10.28以前就安裝了docker,使用的時候有問題好比exit命令退出容器會卡死)
直接使用命令: yum install docker-io 是會報錯的!!! 提示:No package docker-io available.
須要安裝yum 源 yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
安裝epel-release-6-8.noarch.rpm之後直接 yum install docker-io 就能夠正常安裝了!!