Ubuntu14.04升级内核3.14.25

Ubuntu14.04升级内核3.14.25


linux kernel官方网站:
https://www.kernel.org/
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.25.tar.xz

ubuntu二进制内核官方网站:
http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14.25-utopic/linux-headers-3.14.25-031425-generic_3.14.25-031425.201411211235_amd64.deb
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14.25-utopic/linux-headers-3.14.25-031425_3.14.25-031425.201411211235_all.deb
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14.25-utopic/linux-image-3.14.25-031425-generic_3.14.25-031425.201411211235_amd64.deb


我们知道,ubuntu14.04正式版发行时采用的是3.13.0内核,但3.13.0并不是长期LTS内核,2014-12-04时最新的LTS kernel是3.14.25所以这里简单介绍下如何升级到最新LTS内核。


以ubuntu14.04.1 x64为例,
一.二进制内核deb包
1.查看原始版本及内核信息
root@KVM:~# lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:    trusty
root@KVM:~# uname -a
Linux KVM 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
2.下载上面链接中的3个内核deb包并安装
我装的是64bit位ubuntu,所以下载的是64位版本。
root@KVM:~# ls
linux- headers-3.14.25-031425_3.14.25-031425.201411211235_ all.deb
linux- headers-3.14.25-031425-generic_3.14.25-031425.201411211235_ amd64.deb
linux- image-3.14.25-031425-generic_3.14.25-031425.201411211235_ amd64.deb
root@KVM:~# dpkg -i *
Selecting previously unselected package linux-headers-3.14.25-031425.
(Reading database ... 160580 files and directories currently installed.)
Preparing to unpack linux-headers-3.14.25-031425_3.14.25-031425.201411211235_all.deb ...
Unpacking linux-headers-3.14.25-031425 (3.14.25-031425.201411211235) ...
Selecting previously unselected package linux-headers-3.14.25-031425-generic.
Preparing to unpack linux-headers-3.14.25-031425-generic_3.14.25-031425.201411211235_amd64.deb ...
Unpacking linux-headers-3.14.25-031425-generic (3.14.25-031425.201411211235) ...
Selecting previously unselected package linux-image-3.14.25-031425-generic.
Preparing to unpack linux-image-3.14.25-031425-generic_3.14.25-031425.201411211235_amd64.deb ...
Done.
Unpacking linux-image-3.14.25-031425-generic (3.14.25-031425.201411211235) ...
Setting up linux-headers-3.14.25-031425 (3.14.25-031425.201411211235) ...
Setting up linux-headers-3.14.25-031425-generic (3.14.25-031425.201411211235) ...
Setting up linux-image-3.14.25-031425-generic (3.14.25-031425.201411211235) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.14.25-031425-generic /boot/vmlinuz-3.14.25-031425-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.14.25-031425-generic /boot/vmlinuz-3.14.25-031425-generic
update-initramfs: Generating /boot/initrd.img-3.14.25-031425-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.14.25-031425-generic /boot/vmlinuz-3.14.25-031425-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.14.25-031425-generic /boot/vmlinuz-3.14.25-031425-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.14.25-031425-generic
Found initrd image: /boot/initrd.img-3.14.25-031425-generic

Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found initrd image: /boot/initrd.img-3.13.0-32-generic

Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
安装完成后重启,默认会从新内核启动。

ubuntu@KVM:~$ uname -a
Linux KVM 3.14.25-031425-generic #201411211235 SMP Fri Nov 21 17:37:23 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
可以看到,内核己升级为3.14.25,并且grub2默认从新内核启动,原内核仍然保留启动项。
没错,这种更新方法高效快捷。


二.编译kernel源码包
利用快照还原ubuntu的初始状态
编译内核的一般步骤:

1.清除旧目标文件和配置(make mrproper
2.配置内核选项 
a.文本交互 y|n|m"问答"界面( make config
b.文本菜单界面( make menuconfig)#libncures5-dev
c.图形界面 ( make xconfig|gconfig)  #需要qt或gtk开发库支持
d.应答文件( make oldconfig) #.config
推荐使用:文本菜单方式(make menuconfig)
菜单选项功能,根据生产环境进行配置:
                 General setup  --->                          # 普通安装                                                        
             [*] Enable loadable module support  --->         # 是否支持外挂模块的功能                                
             -*- Enable the block layer  --->                 #块设备                                  
                 Processor type and features  --->            #cpu的类型和功能(主要修改选项)
Processor type and features:子菜单:
                                     Processor family (Generic-x86-64):选择cpu的类型
                 Power management and ACPI options  --->      #电源管理                                  
                 Bus options (PCI etc.)  --->                 #pci总线的配置                                  
                 Executable file formats / Emulations  --->   #可执行二进制文件格式                    

转载于:https://www.cnblogs.com/lixuebin/p/10814463.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值