Upgrade and subsequent reinstall both hung on Nextcloud

Same thing happened to me and a few others… fix for it here Upgrade from 0.5 to 0.51 error