The image I was running this script on was not up to date on the latest version of ubuntu. Switching to that fixed the issue.