Ask Your Question

A module is not used, but is in use and cannot be removed

asked 2018-05-10 21:12:41 -0500

hsljo gravatar image

Trying to remove this module but no luck:

[use0@localhost ~]$ lsmod|grep rfkill
rfkill                 28672  1
[use0@localhost ~]$ sudo modprobe -r rfkill 
modprobe: FATAL: Module rfkill is in use.
[use0@localhost ~]$ sudo rmmod rfkill 
rmmod: ERROR: Module rfkill is in use

I removed the only dependency it had cfg80211 but rfkill is still not unloading.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-05-11 01:02:09 -0500

villykruse gravatar image

updated 2018-05-13 00:31:45 -0500

Check following

systemctl status systemd-rfkill.socket


pidof wpa_supplicant

Then kill wpa_supplicant and stop the systemd-rfkill.socket and see of the usage count for rfkill is now 0.

wpa_supplicant is via a the systemd-rfkill.socket using the /dev/rfkill device to determine if wifi is enabled or not.

edit flag offensive delete link more


Thanks, I blacklisted the module in the mean time. The second command returns this error: pidof: invalid option -- i

hsljo gravatar imagehsljo ( 2018-05-12 20:33:27 -0500 )edit

It is supposed to be

pidof wpa_supplicant
villykruse gravatar imagevillykruse ( 2018-05-13 00:32:44 -0500 )edit

answered 2018-05-15 07:24:35 -0500

jo_117 gravatar image

use rmmod rfkill or use modeprobe -r rfkill

also check if it has dependencies by using modeprobe --show depends if there then rmmod that depends also.

else blacklist the module in (vi /etc/modeprobe.d/blacklist.conf install rfkill /bin/true )

hope it helps.....

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-05-10 21:12:41 -0500

Seen: 99 times

Last updated: May 15 '18