Updated: Fixing Fedora 12 and nvidia black screen at startup
I recently updated my Fedora 12 workstation at work and was greeted with a black screen at reboot. Actually, the screen shut off almost immediately. The console was unresponsive, so I couldn’t even log in locally by switching to a local console. (You know you are in trouble when Ctrl-Alt-F2 doesn’t work.)
From my laptop I SSH’d in and discovered that the nvidia driver had oops’d and killed X11 very dead. Searching the forums led me to believe my problem was from the most recent kernel update and selecting the previous kernel from the grub screen proved to boot normally.
This is the first occasion where I’ve ever needed to blacklist an item from yum. The process is pretty simple, so I’m jotting it down here for future reference.
First, determine the package which is causing the problem, the “kernel-2.6.32.9-70″ in this case.
Note: if you have a recent clean installation, which doesn’t contain an older “safe” kernel in the grub menu you can probably still boot into single user mode.
$ rpm -q kernel
kernel-2.6.31.12-174.2.19.fc12.x86_64 kernel-2.6.31.12-174.2.22.fc12.x86_64 kernel-2.6.32.9-70.fc12.x86_64
Next, edit the /etc/yum.conf file to add the broken package to the excluded list. In this case the most recent kernel, 2.3.32.9 seems to be the problem.
$ su -c "vim /etc/yum.conf"
Add the following line to exclude this exact package. You may also use wildcards, in the form “kernel-2.3.32*” and separate items with spaces. By blacklisting the entire kernel 2.3.32 series with a wildcard you can remain on the stable 2.3.31 kernel until some of the issues are ironed out.
Remember, when blacklisting the kernel, there is more than one RPM related to the kernel. If you use akmod to build a new nvidia driver you will also need to blacklist the -headers and -devel RPMs.
exclude=kernel-2.6.32.9-70.fc12.x86_64
Here’s what my yum.conf looked like when I was done, for reference.
[main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3 exclude=kernel-2.6.32* kernel-headers-2.3.32* kernel-devel-2.3.32* kernel-firmware-2.3.32* # This is the default, if you make this bigger yum won't see if the metadata # is newer on the remote and so you'll "gain" the bandwidth of not having to # download the new metadata and "pay" for it by yum not having correct # information. # It is esp. important, to have correct metadata, for distributions like # Fedora which don't keep old packages around. If you don't like this checking # interupting your command line usage, it's much better to have something # manually check the metadata once an hour (yum-updatesd will do this). # metadata_expire=90m # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d
Finally, remove the broken packages from the system.
su -c "yum remove kernel-2.6.32.9-70.fc12.x86_64 kernel-headers-2.6.32.9-70.fc12.x86_64 kernel-devel-2.6.32.9-70.fc12.x86_64 kernel-firmware-2.6.32.9-70.fc12.x86_64"
UPDATE 2010-04-06
I have updated this post to improve the original instructions if your system doesn’t have a previous working kernel. This recently happened to me when I clean installed a machine with the Fedora Updates repository enabled during installation.
I had failed to blacklist the related kernel RPMs such as kernel-headers, this prevents akmod from creating new drivers if you haven’t already generated them.
If you have a clean installation which contains the 2.3.32 kernel you can “yum downgrade” the packages:
su -c "yum downgrade kernel kernel-headers kernel-devel kernel-firmware"
I had some trouble downgrading the -devel package, so instead I “yum install”‘d it again and yum installed the non-blacklisted previous version alongside the blacklisted version. I then removed the broken -devel package. Make sure that you double-check that you have removed the new/offending RPMs before you restart.
rpm -qa | grep kernel
