Question: why internal energy of an ideal gas depends only on temperature?
Answer: The meaning of “depend only on temperature” is that the internal energy of the gas does not change when it is allowed to expand into a vacuum. In that sense, the internal energy is independent of pressure and volume, and therefore dependent only on temperature.