A good CI/CD, with some precommits and a containerised stack should avoid you all those troubles.
Also, nothing force you to update to the newest version, you can stay approximately 5y on the same release, but keeping the pace makes the upgrades less costly and less risky in the long run because you don't accumulate deprecated features, you're forced to cleanup the abandoned dependencies, ... It also makes the team happier and more attractive when recruiting.