omg, finally the most annoying problem got solved!
Thank you! I didn't try the script yet but thank you very much.
I kept trying to get it working too long time ago with no way.
I kept going deep to know what's going on with no luck too.
all that tutorials on CODE/owncloud/nextcloud does not work.
I tried commands in dockerfile (without docker) and does not work too.
I didn't dare to start with compilation, I felt like I'm going to the unknown!
my observation is,
there's no directory /etc/sysconfig in ubuntu 16.04, I can see source some how to be complied with rpm, while CODE people introduced deb packages.
I will start with your script and let you know, if any