CommCareHQ and its packages are only maintained for compatibility with Ubuntu 18, so it will be quite difficult to get a working installation of the current code.
Is there a reason you are restricted to Ubuntu 12? Ubuntu 12 is significantly out of date and doesn't receive security patches or other critical fixes, so we wouldn't recommend running on it. If your host machine is only capable of running Ubuntu 12 you may consider running a virtualized environment with an Ubuntu 18 OS.