It happens to me during the upgrade of Ubuntu 20.04 LTS to Ubuntu 22.04 LTS. My system has installed openmpi-bin (4.1.2-2ubuntu1).
A had run the pre-removal script manually with following result:
$ sudo sh -x /var/lib/dpkg/info/openmpi-bin.prerm remove + set -e + [ remove = remove ] + update-alternatives --remove mpirun /usr/bin/mpirun.openmpi + update-alternatives --remove mpi /usr/bin/mpicc.openmpi update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc
[That solution](https://stackoverflow.com/questions/62464085/openmpi-bin-error-after-update-kubuntu-18-04-to-20-04) fixes the situation
It happens to me during the upgrade of Ubuntu 20.04 LTS to Ubuntu 22.04 LTS. My system has installed openmpi-bin (4.1.2-2ubuntu1).
A had run the pre-removal script manually with following result:
$ sudo sh -x /var/lib/ dpkg/info/ openmpi- bin.prerm remove mpirun. openmpi mpicc.openmpi alternatives: error: /var/lib/ dpkg/alternativ es/mpi corrupt: slave link same as main link /usr/bin/mpicc
+ set -e
+ [ remove = remove ]
+ update-alternatives --remove mpirun /usr/bin/
+ update-alternatives --remove mpi /usr/bin/
update-
[That solution](https:/ /stackoverflow. com/questions/ 62464085/ openmpi- bin-error- after-update- kubuntu- 18-04-to- 20-04) fixes the situation