First remove the update-alternatives for openmpi:
sudo rm -f /etc/alternatives/mpi* /var/lib/dpkg/alternatives/mpi*
Then install openmpi-bin again:
sudo apt install open-mpi
answer Y when asked for confirmation.
In Ubuntu 22.04 (or if the above line doesn’t work) – try this instead:
sudo apt install openmpi-bin