Sunday, August 16, 2009

emerge x11-drivers/nvidia-drivers compilation failed Could not find a usable .config

Problem :
When you update x11-drivers/nvidia-drivers, the compilation fails.
Example :
* Could not find a usable .config in the kernel source directory.
* Please ensure that /usr/src/linux points to a configured set of Linux sources.
* If you are using KBUILD_OUTPUT, please set the environment var so that
* it points to the necessary object directory so that it might find .config.
* ERROR: x11-drivers/nvidia-drivers-185.18.31 failed.

Solution :

You aren't on the good kernel.This is because during update the link is change.
If you do :
ls -al /usr/src/
lrwxrwxrwx 1 root root 22 Aug 16 16:30 linux -> linux-2.6.30-gentoo-r1
drwxr-xr-x 22 root root 4096 Nov 29 2008 linux-2.6.26-gentoo-r3
drwxr-xr-x 23 root root 4096 Dec 6 2008 linux-2.6.27-gentoo-r4
drwxr-xr-x 23 root root 4096 Aug 9 13:36 linux-2.6.30-gentoo-r1

You see that the link points on an other kernel and you have'nt compile source for this kernel.
That's why there is no .config files.
So there is two solutions :
- Compile new kernel sources.
- Point on good kernel.

We will take the easier solution : Select your kernel.
To do that :
# eselect kernel list
Available kernel symlink targets:
[1] linux-2.6.26-gentoo-r3
[2] linux-2.6.27-gentoo-r4
[3] linux-2.6.27-gentoo-r5
[4] linux-2.6.27-gentoo-r7
[5] linux-2.6.28-gentoo
[6] linux-2.6.28-gentoo-r1
[7] linux-2.6.29-gentoo-r2
[8] linux-2.6.29-gentoo-r4
[9] linux-2.6.30-gentoo-r1 *
[10] linux-2.6.30-gentoo-r2

Then you can point on the good kernel :
# eselect kernel set 9

If you execute eselect kernel list, you will see a start on the select kernel.
Then you can make an update of the package :
#emerge -u x11-drivers/nvidia-drivers

No comments:

Post a Comment