We analyze homogeneous and quasi-homogeneous thermodynamic systems within the formalism of geometrothermodynamics (GTD). A generalized Euler identity is used to obtain the explicit form of the three Legendre invariant metrics that are known in GTD for the equilibrium space. In so doing, we fix all the arbitrary parameters that enter the GTD metrics in terms of the quasi-homogeneous coefficients. We obtain quite general results that relate the curvature singularities of the equilibrium space with the thermodynamic stability conditions and the phase transition structure of the system. This result allows us to avoid the appearance of non-physical singularities at the level of the equilibrium space.