fedora 内核更新

在安装一 个新的fedora发行版本后,可以选择升级所有的软件,也可以只升级下fedora编译过的内核包,在测试完新的内核后,再把旧的内核包卸载掉,节约空 间。这里只探讨fedora的自动在线升级方式,没有使用手动的方式,也即意味着会自动搞定vmlinuz,initrd.img,system.map 等文件的位置,以及Grub的配置文件/etc/grub/grub.conf的修改。
一、升级fedora的内核

a.查看目前内核版本

[qkshan /boot]$uname -r
2.6.29.4-167.fc11.i686.PAE

b.查看最新可用 的内核

[qkshan /]$sudo yum list kernel
Loaded plugins: axelget, fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirrors.163.com
* rpmfusion-free: fr2.rpmfind.net
* rpmfusion-free-updates: fr2.rpmfind.net
* rpmfusion-nonfree: fr2.rpmfind.net
* rpmfusion-nonfree-updates: fr2.rpmfind.net
* updates: ftp.mirror.tw
Available Packages
kernel.i586    2.6.30.9-96.fc11          updates

c.安装新内核

[qkshan /]$sudo yum install kernel.i586

注:不会覆盖原来 的内核的,即使是update也不会

二、卸载fedora的旧内核

      当更新内核包后或安装的新内核有问题,我们需要卸载掉该内核,
首先查看已安装kernel相关包:

[qkshan /boot]$sudo rpm -qa |grep kernel
kernel-firmware-2.6.30.8-64.fc11.noarch
kernel-PAE-devel-2.6.30.8-64.fc11.i686
kerneloops-0.12-5.fc11.i586
kernel-PAE-2.6.29.4-167.fc11.i686
kernel-headers-2.6.30.8-64.fc11.i586
kernel-PAE-2.6.30.8-64.fc11.i686

当检验新安装的内核没有问题后,把旧的内核包卸掉:
[qkshan /boot]$sudo rpm -qa |grep kernel |grep 167
kernel-PAE-2.6.29.4-167.fc11.i686
[qkshan /boot]$sudo yum remove kernel-PAE-2.6.29.4-167.fc11.i686

另外,如果在更新系统时不想更新kernel相关包,
在 /etc/yum.conf中增加红色的一行:
$ sudo vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
exclude=kernel*

试下update,可以发现没有再提示有关kernel*的包升级了哈

[qkshan /]$sudo yum update
Loaded plugins: axelget, fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
fedora/metalink                                                           | 9.8 kB     00:00    
updates/metalink                                                          | 8.6 kB     00:00    
* fedora: mirrors.163.com
* rpmfusion-free: fr2.rpmfind.net
* rpmfusion-free-updates: fr2.rpmfind.net
* rpmfusion-nonfree: fr2.rpmfind.net
* rpmfusion-nonfree-updates: fr2.rpmfind.net
* updates: ftp.mirror.tw
adobe-linux-i386                                                          |  951 B     00:00    
rpmfusion-free                                                            | 3.3 kB     00:00    
rpmfusion-free-updates                                                    | 3.8 kB     00:00    
rpmfusion-nonfree                                                         | 3.3 kB     00:00    
rpmfusion-nonfree-updates                                                 | 3.8 kB     00:00    
Setting up Update Process
No Packages marked for Update

你可能感兴趣的:(linux)