I am tempted to try some of the ideas suggested in this thread of replies:
Error on ERPNext - Ubuntu 18.04 LTS Installation - #16 by Muzzy
or just forego the script altogether and follow the instructions here:
https://discuss.frappe.io/t/how-to-install-erpnext-from-a-z/54744/4