# Modprobe uses the wrong kernel

## Ayara

Hello!

I've just installed Gentoo, and I had a problem when trying to load a module:

```

# modprobe fuse

modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.6-gentoo

```

The problem is, the kernel I'm using isn't 4.4.6 but 4.6.3, and the module does exist in /lib/modules/4.6.3-gentoo.

Both kernel versions are in /lib/modules and in /usr/src, but when I tried to run 'eselect kernel list' I could only see 4.6.3, which was selected, and /usr/src/linux points to /usr/src/4.6.3-gentoo.

Does someone know what's happening ?

Thank you for your answers.

----------

## eccerr0r

Well, the eselect kernel shouldn't have any effect unless you somehow got the tracking system all confused by copying or renaming files incorrectly...  Modprobe uses the output of depmod and whatever's in /lib/modules/...

First off, are you sure you're running the 4.6.3 kernel (doesn't hurt to doublecheck with uname -a)?  This would be the easiest solution.

Does "depmod -a" work or does it also give the wrong directory?

----------

## guitou

Hello.

You probably uninstalled your 4.4.6 kernel while using "emerge --depclean". Then emerging again should solve the problem.

++

Gi)

----------

## Ayara

Actually, both depmod -a and uname -a show 4.4.6, but the version of gentoo-sources I have installed is 4.6.3. I tried to recompile 4.4.6 to enable FUSE, but there is no Makefile in /usr/src/linux-4.4.6-gentoo ! I tried emerging gentoo-sources again, but it didn't solve it.

----------

## Jaglover

```
emerge -pv gentoo-sources
```

What version of sources will this install?

----------

## Ayara

This installs 4.6.3:

```

$ emerge -pv gentoo-sources

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] sys-kernel/gentoo-sources-4.6.3:4.6.3::gentoo  USE="-build -experimental -kdbus -symlink" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

```

----------

## Jaglover

You need to execute 

```
emerge -av =gentoo-sources-4.4.6
```

 to [re]install sources for 4.4.6.

----------

## Goverp

 *Ayara wrote:*   

> Actually, both depmod -a and uname -a show 4.4.6, but the version of gentoo-sources I have installed is 4.6.3. I tried to recompile 4.4.6 to enable FUSE, but there is no Makefile in /usr/src/linux-4.4.6-gentoo ! I tried emerging gentoo-sources again, but it didn't solve it.

 

Problem 1 is that you may have installed the sources for 4.6.3, but something went wrong between there and the kernel you are running.  I presume you built the new kernel

```
cd /usr/src/linux-4.6.3-gentoo

make

make modules_install
```

so did you then install that kernel to /boot?  (I use "make install", but there are several other ways including copying the vmlinuz and initramfs (if any)).  If you have a separate boot partition, did you remember to mount if before installing the kernel?  And did you reconfigure your boot loader to use it (this may not be necessary, depending on how you installed it).

Problem 2, as implied in other posts, the reason you have no Makefile for 4.4.6 is that you've run "emerge --depclean", and it's wiped the 4.4.6 sources, though not your old configuration, which is why you could configure FUSE but not make the kernel.  Note that to fix this, you need to

```
emerge =sys-kernel/gentoo-sources-4.4.6
```

Note that you must have the "=" and "-4.4.6" or you merely reinstall 4.6.3, which is no help.

----------

## Ayara

OK, I had assumed that /boot was mounted when I compiled the kernel, but it wasn't...

Thanks for your help, it works now!

----------

