Installation issues - unmet dependencies
The command you're running, on Ubuntu 16.04, attempts to install the nodejs-legacy package.  As it says, it can't because it relies on a particular version of nodejs that won't be installed.

So first - this problem should be replicable with a simple sudo apt install nodejs-legacy, which simplifies the variables and takes CiviCRM out of the equation.  It's probably even replicable with sudo apt install nodejs.

Second, it sounds like you have something installed - perhaps a newer version of nodejs? - that's preventing an installation of the packaged version of nodejs.

After removing nodejs, try running dpkg -l | grep nodejs and see what, if any packages are installed.

Alternatively, removing --full from your command will disable attempting to autoinstall packages.  If your environment is a good one, this should work fine.  You can review the packages you need installed in this part of the script.