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?
1 Answer
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.
-
1Thank you for your answer. However, I'm not sure why I have been downvoted for asking a question? :( Dec 31, 2016 at 20:49
-
4@AaronFranke you have been downvoted because them downvote fairies were having a bad day.– GeneCodeAug 9, 2018 at 5:29