The structural, electronic, mechanical, dynamical and thermodynamic properties of rare-earth dihydrides XH2 (X=Sc, Y, and La) with the cubic fluorite structure have been systematically investigated by using the projector augmented wave (PAW) method within the generalized-gradient approximation. The calculated lattice parameters, electronic structures and elastic constants of XH2 agree well with available experimental data and other theoretical results. Both the lattice constants and the equilibrium unit cell volumes increase in accordance with heavier rare-earth atom. From the obtained bulk modulus, shear modulus and Young's modulus, the resistance to volume change, shear deformations, and even tensile and compressive deformations weakens from ScH2 to LaH2 successively. The brittle/ductile properties of the three compounds are determined by the ratio of B/G and the Cauchy pressure C12−C44. Poisson's ratio, elastic anisotropy factor, Debye temperature, and sound velocities of XH2 are also predicted. Especially, the phonon dispersion curves and corresponding phonon density of states of XH2 are determined using a linear-response approach to density functional perturbation theory (DFPT) successfully, the phonon frequencies (in THz) obtained at the zone-center (Γ-point) for infrared-active modes T1u and Raman-active modes T2g are ScH2: T1u=29.294, T2g=35.279; YH2: T1u=27.295, T2g=32.624; and LaH2: T1u=24.286, T2g=28.004. Our results show that the three compounds can be stabilized dynamically and mechanically in the ground state phase of the cubic fluorite structure. The thermodynamic functions such as phonon contributions to the internal energy E, the Helmholtz free energy F, the entropy S, the changes of H–H298.15 and G–G298.15 and the constant volume specific heat CV under high temperatures are also obtained based on phonon density of states.