The normal state of cuprates is dominated by the strange metal phase that, near optimal doping, shows a linear temperature dependence of the resistivity persisting down to the lowest $T$, when superconductivity is suppressed. For underdoped cuprates this behavior is lost below the pseudogap temperature $T$*, where Charge Density Waves(CDW) together with other intertwined local orders characterize the ground state. Here we show that the $T$-linear resistivity of highly strained, ultrathin and underdoped YBa$_2$Cu$_3$O$_{7-delta}$ films is restored when the CDW amplitude, detected by Resonant Inelastic X-ray scattering, is suppressed. This observation points towards an intimate connection between the onset of CDW and the departure from $T$-linear resistivity in underdoped cuprates, a link that was missing until now. It also illustrates the potentiality of strain control to manipulate the ground state of quantum materials.