The answer to that ought to be `apt-get install nextcloud-server` and let the distro maintainers step in, really. Unfortunately because you can't skip versions on upgrade, it's not clear how to cleanly do that.
The package manager would need to have access to the code of all the intermediate versions to run the upgrades safely. That might work for some situations, but it's a hell of an overhead in general.