How to install ROOT on centos-9? Some errors on different methods

Try disabling xrootd when calling cmake.
See how here Build Problem with XROOTD on ROOT v6-22-00 - #7 by amadio

You can also try with -Dminimal=ON