One of the arguments of /sbin/depmod set by kmodtool is wrong.

Solution Verified - Updated -


  • WARNING and FATAL are displayed when I uninstall a kmod package that I made.

      # rpm -e kmod-sample-1.0.0-1.i686
      WARNING: Couldn't open directory /lib/modules/2.6.32-37.el6: No such file or directory
      FATAL: Could not open /lib/modules/2.6.32-37.el6/modules.dep.temp for writing: No such file or directory
  • The cause is that at %post section in kmodtool the second argument of /sbin/depmod is "${verrel}.%{_target_cpu}${dotvariant}", but at %postun section it's "${verrel}${variant}".

            120 %post          -n kmod-${kmod_name}${dashvariant}
            121 if [ -e "/boot/${verrel}.%{_target_cpu}${dotvariant}" ]; then
      *---->122     /sbin/depmod -aeF "/boot/${verrel}.%{_target_cpu}${dotvariant}" "${
            verrel}.%{_target_cpu}${dotvariant}" > /dev/null || :
            123 fi
            139 %postun        -n kmod-${kmod_name}${dashvariant}
            140 if [ -e "/boot/${verrel}.%{_target_cpu}${dotvariant}" ]; then
      *---->141     /sbin/depmod -aeF "/boot/${verrel}.%{_target_cpu}${dotvariant}" "${
            verrel}${variant}" > /dev/null || :
            142 fi
  • Therefore, at %postun section in kmodtool I'd like you to change the second argument to "${verrel}.%{_target_cpu}${dotvariant}".


  • Red Hat Enterprise Linux 6.0 beta2
  • Architecture: x86,intel64
  • redhat-rpm-config-9.0.3-20.el6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content