nerdexam
CompTIA

XK0-004 · Question #167

A systems administrator notices a large number of autoloaded device modules are no longer needed and decides to do a cleanup of them. Which of the following commands will accomplish this task?

The correct answer is D. modprobe -r. modprobe with the -r flag is the correct tool for removing kernel modules and their no-longer-needed dependencies from a running system.

System Management

Question

A systems administrator notices a large number of autoloaded device modules are no longer needed and decides to do a cleanup of them. Which of the following commands will accomplish this task?

Options

  • Armmod -c
  • Bdepmod -r
  • Cinsmod -c
  • Dmodprobe -r

How the community answered

(27 responses)
  • A
    7% (2)
  • B
    4% (1)
  • D
    89% (24)

Why each option

modprobe with the -r flag is the correct tool for removing kernel modules and their no-longer-needed dependencies from a running system.

Armmod -c

rmmod removes a single, explicitly named module but does not handle dependency cleanup and does not accept a -c flag for this purpose.

Bdepmod -r

depmod generates a modules dependency map (modules.dep) and does not remove or unload modules; -r is not a valid option for depmod.

Cinsmod -c

insmod installs (inserts) a single kernel module and has no cleanup functionality.

Dmodprobe -rCorrect

modprobe -r (remove) unloads a specified kernel module and recursively removes any dependent modules that are no longer in use, making it the appropriate tool for cleaning up autoloaded modules that are no longer needed.

Concept tested: Removing kernel modules and dependencies with modprobe

Source: https://www.man7.org/linux/man-pages/man8/modprobe.8.html

Topics

#modprobe#kernel modules#module removal#device drivers

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice