20

The Arch wiki recommended creating a file in /etc/udev/rules.d/ to fix my Steam controller issues. This worked! However, I noticed that there are no other rules in this folder except for the one I just created. Additionally, all other sources I've seen say to place udev rules in /lib/udev/rules.d/, and there are plenty of other udev rules in this folder too. Why are there two folders for seemingly the same thing, and which one should I use?

28

The difference between the two folders is that:

/lib/udev/rules.d

Contains default rules files. Do not edit these files.

/etc/udev/rules.d/*.rules

Contains customized rules files. You can modify these files or create them.

However, files with identical file names replace each other. Files in /etc have the highest priority and take precedence over files with the same name in /lib. This can be used to override the default rules.

Another thing, to disable the the rules file entirely, you can create a symlink in /etc with the same name as a rules file in /lib, pointing to /dev/null.

So to finish, Udev rules written by the administrator go in /etc/udev/rules.d/, and their file name has to end with .rules. The default udev rules are found in /lib/udev/rules.d/ (or /usr/lib/udev/rules.d). If there are two files by the same name under /lib and /etc, the ones in /etc take precedence.

  • Thank you for your answer. However, I'm not sure why I have been downvoted for asking a question? :( – Aaron Franke Dec 31 '16 at 20:49
  • 3
    @AaronFranke you have been downvoted because them downvote fairies were having a bad day. – GeneCode Aug 9 '18 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.