Because of server update I wondered how ww_install script works with new version of WeBWorK 2.16 which is (I think) close.
Basically, it can be modified slightly to consider new dependencies and npm install. If the command which creates mysql user and sets permissions is divided into two calls, it works also on Ubuntu. The fork is https://github.com/robert-marik/ww_install/tree/update_2-16 and should work on Ubuntu 21.04, Debian 10 and Debian 9. Feel free to use it. I commented out the parts related to OPL Library and it is not downloaded, but you may revert this change.
Only on Debian 10 it works on 100%. See the README file for minor comments related to Ubuntu (minor fix related to ownership of tmp dir) and Debian 9 (install npm first, run the script twice and install missing latex sty files not from texlive-latex-recommended to save space).
I also observed that the previous version on Debian 9 installed unnecessary pacakges as texlive-latex-extra-doc or texlive-latex-recommended-doc if the ww_install script has been used for installation. Removing these packages saves more than 500MB disk space.