Some distros support rejecting touchpad events for N seconds after the last keystroke. That is 100% software, and sort of works for even the worst touchpads.
Edit: Oh, you mention Ubuntu. I gave up on them a long time ago. Devuan works well if you want old-school Debian. Manjaro works well if you want a stable "modern" desktop environment (like Ubuntu used to provide) with menus for hardware configuration, user session switching, etc.