Centos – How RPM found conflict during installation

centosrpm

I was building an rpm. I ran rpm -ivh X.rpm but got an error file /lib/modules/abc conflicts with file from package Y.
My question is how rpm check the conflicts?
can I use all these conflicts in the spec file so I don't get all these conflict.

Best Answer

rpm keeps track of all files installed by all rpm packages. Two packages cannot provide the same file or folder. So you just must make sure that all your packages provide a complete distinct set of files and folders.