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.
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)- A7% (2)
- B4% (1)
- D89% (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.
rmmod removes a single, explicitly named module but does not handle dependency cleanup and does not accept a -c flag for this purpose.
depmod generates a modules dependency map (modules.dep) and does not remove or unload modules; -r is not a valid option for depmod.
insmod installs (inserts) a single kernel module and has no cleanup functionality.
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
Community Discussion
No community discussion yet for this question.