Available information concerning the elastic moduli of refractory carbides at temperatures (T) of relevance for practical applications is sparse and/or inconsistent. We carry out ab initio molecular dynamics (AIMD) simulations at T = 300, 600, 900, and 1200 K to determine the temperature-dependences of the elastic constants of rocksalt-structure (B1) TiC, ZrC, HfC, VC, and TaC compounds as well as multicomponent high-entropy carbides (Ti,Zr,Hf,Ta,W)C and (V,Nb,Ta,Mo,W)C. The second order elastic constants are calculated by least-square fitting of the analytical expressions of stress vs. strain relationships to simulation results obtained from three tensile and three shear deformation modes. Moreover, we employ sound velocity measurements to evaluate the bulk, shear, elastic moduli and Poissons ratios of single-phase B1 (Ti,Zr,Hf,Ta,W)C and (V,Nb,Ta,Mo,W)C at ambient conditions. Our experimental results are in excellent agreement with the values obtained by AIMD simulations. In comparison with the predictions of previous ab initio calculations - where the extrapolation of finite-temperature elastic properties accounted for thermal expansion while neglecting intrinsic vibrational effects - AIMD simulations produce a softening of elastic moduli with T in closer agreement with experiments. Results of our simulations show that TaC is the system which exhibits the highest elastic resistances to both tensile and shear deformation up to 1200 K, and identify the high-entropy (V,Nb,Ta,Mo,W)C system as candidate for applications that require good ductility and toughness at room as well as elevated temperatures.