- 论坛徽章:
- 0
|
作者:duanli, 来源:
[color="#0000ff"]http://duanli.cublog.cn
说明:转载请注明来源,交流请Email给作者
在安装一个新的fedora发行版本后,可以选择升级所有的软件,也可以只升级下fedora编译过的内核包,在测试完新的内核后,再把旧的内核包卸载掉,节约空间。
一、升级fedora的内核
a.查看目前内核版本
[qkshan /boot]$uname -r
2.6.30.5-43.fc11.i686.PAE
b.
二、卸载fedora的旧内核
Suppose you want to remove a specific version of kernel package because it's causing a kernel panic.
Here is how you can remove them with yum in FC3:
[tchung@tchung-fc3 ~]$ rpm -qa | grep kernel
kernel-smp-2.6.9-1.678_FC3
kernel-smp-2.6.9-1.667
kernel-2.6.9-1.667
kernel-utils-2.4-13.1.39
kernel-2.6.9-1.678_FC3
[tchung@tchung-fc3 ~]$ rpm -qa | grep kernel | grep 678
kernel-smp-2.6.9-1.678_FC3
kernel-2.6.9-1.678_FC3
[tchung@tchung-fc3 ~]$ sudo yum remove kernel-smp-2.6.9-1.678_FC3 kernel-2.6.9-1.678_FC3
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package kernel-smp.i686 0:2.6.9-1.678_FC3 set to be erased
---> Package kernel.i686 0:2.6.9-1.678_FC3 set to be erased
--> Running transaction check
Dependencies Resolved
Transaction Listing:
Remove: kernel.i686 0:2.6.9-1.678_FC3
Remove: kernel-smp.i686 0:2.6.9-1.678_FC3
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing: kernel 1/2
Erasing: kernel-smp 2/2
Removed: kernel.i686 0:2.6.9-1.678_FC3 kernel-smp.i686 0:2.6.9-1.678_FC3
Complete!
[tchung@tchung-fc3 ~]$
Now make sure your grub.conf is correct before the reboot.
Notice, the stanza for kernel version you've just removed is not there any more in /etc/grub.conf
[tchung@tchung-fc3 ~]$ sudo vi /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 have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.9-1.667smp)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667smp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.9-1.667smp.img
title Fedora Core-up (2.6.9-1.667)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.9-1.667.img
BTW, if you want to exclude kernel packages from installing with yum, add following red line in /etc/yum.conf:
[tchung@tchung-fc3 ~]$ sudo vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1
[color="red"]exclude=kernel*
[qkshan /boot]$sudo rpm -qa |grep kernel
kernel-PAE-2.6.30.5-43.fc11.i686
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-PAE-devel-2.6.30.5-43.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
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104492/showart_2066208.html |
|