To remove a module, joydev in this example, use the following:
Click here to view code image
matthew@seymour:~$ sudo rmmod joydev
or use this:
Click here to view code image
matthew@seymour:~$ sudo modprobe -r joydev
The output of lsmod now shows that it is no longer loaded. If you were to
remove input as well, you could then use modprobe to load both input
and joydev (one depends on the other, remember) with a simple command,
as follows:
Click here to view code image
matthew@seymour:~$ sudo modprobe joydev
If Ubuntu balks at loading a module (because it was compiled using a
different kernel version from what you are currently running; for example, the
NVIDIA graphics card module), you could force it to load like this:
Click here to view code image
matthew@seymour:~$ sudo insmod -f nvidia
You ignore the complaints (error messages) in this case if the kernel generates
any.
When to Recompile
Ubuntu systems use a modified version of the plain-vanilla Linux kernel (a
modified version is referred to as a patched kernel) with additional drivers
and other special features compiled into it.
Ubuntu has quite an intensive testing period for all distribution kernels and
regularly distributes updated versions. The supplied Ubuntu kernel is
compiled with as many modules as possible to provide as much flexibility as
possible. A running kernel can be further tuned with the sysctl program,
which enables direct access to a running kernel and permits some kernel
parameters to be changed. As a result of this extensive testing, configurability,
and modularity, the precompiled Ubuntu kernel does everything most users
need it to do. Most users only need to recompile the kernel to do the
following:
Accommodate an esoteric piece of new hardware