package openmpi-bin 4.1.2-2ubuntu1 failed to install/upgrade: installed openmpi-bin package post-installation script subprocess returned error exit status 2

Bug #1970985 reported by Chris Seddon
206
This bug affects 46 people
Affects Status Importance Assigned to Milestone
openmpi (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

ubuntu 22.04 doesn't install properly on my dell machine

ProblemType: Package
DistroRelease: Ubuntu 22.04
Package: openmpi-bin 4.1.2-2ubuntu1
ProcVersionSignature: Ubuntu 5.13.0-40.45-lowlatency 5.13.19
Uname: Linux 5.13.0-40-lowlatency x86_64
NonfreeKernelModules: vboxnetadp vboxnetflt vboxdrv compat
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Fri Apr 29 15:59:34 2022
DistributionChannelDescriptor:
 # This is the distribution channel descriptor for the OEM CDs
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-bionic-amd64-20180608-47+berlinetta-cfl-r+X79
DuplicateSignature:
 package:openmpi-bin:4.1.2-2ubuntu1
 Setting up openmpi-bin (4.1.0-10ubuntu1) ...
 update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc
 dpkg: error processing package openmpi-bin (--configure):
  installed openmpi-bin package post-installation script subprocess returned error exit status 2
ErrorMessage: installed openmpi-bin package post-installation script subprocess returned error exit status 2
InstallationDate: Installed on 2020-11-02 (542 days ago)
InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20180608-09:38
Python3Details: /usr/bin/python3.10, Python 3.10.4, python3-minimal, 3.10.4-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.18, python-is-python2, 2.7.18-9
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions:
 dpkg 1.21.1ubuntu2
 apt 2.4.5
SourcePackage: openmpi
Title: package openmpi-bin 4.1.2-2ubuntu1 failed to install/upgrade: installed openmpi-bin package post-installation script subprocess returned error exit status 2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Chris Seddon (christopherseddon) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openmpi (Ubuntu):
status: New → Confirmed
Revision history for this message
America (acirema) wrote :

Hello,

This worked for me:

sudo rm -f /etc/aternatives/mpi* /var/lib/dpkg/alternatives/mpi*

sudo apt install openmpi-bin

Source: https://stackoverflow.com/questions/62464085/openmpi-bin-error-after-update-kubuntu-18-04-to-20-04

Revision history for this message
Chris Seddon (christopherseddon) wrote : Re: [Bug 1970985] Re: package openmpi-bin 4.1.2-2ubuntu1 failed to install/upgrade: installed openmpi-bin package post-installation script subprocess returned error exit status 2

On 02/05/2022 11:03, America wrote:
> sudo apt install openmpi-bin
seemed to work for me too

tags: removed: need-duplicate-check
Revision history for this message
Luis de la O (ldelaoa) wrote :

this works for me as well on 22.04

Revision history for this message
Dominique Pellé (dominique-pelle) wrote :

Just to confirm that the workaround posted by acirema on 2022-05-02 worked for me too. Thanks.

Revision history for this message
Lucy Fontana (lucyfortune) wrote :

I hope this can be useful to others with the same problem that seemed unsolvable to me and which I found when trying to install ROS Humble on Ubuntu 22.04 LTS.
I had made an upgrade from Ubuntu 18.04 to 20.04 and then to 22.04 LTS.
This type upgrade is prone to leave some inconsistencies in the system and may be the reason why none of the solutions I found on the web, and which applied to Ubuntu 22.04 could solve the issue. I also asked ChatGPT for help but it did not found a solution (although its hints seemed correct for simpler cases).

None of the above-posted solutions solved my problem but the one by America (acirema) put me on the right track to address it.

The file /var/lib/dpkg/alternatives/mpi did not exist in my system; instead the file installed was mpi-x86_64-linux-gnu

Applying:
sudo update-alternatives --remove mpirun /usr/bin/mpirun.openmpi
sudo update-alternatives --remove mpi /usr/bin/mpicc.openmpi
sudo dpkg --configure -a

or simply removing the files as suggested with (Note of caution: I always backup system files before deleting them):

sudo rm /etc/aternatives/mpi*
sudo rm -f /var/lib/dpkg/alternatives/mpi*

did not solve the problem. When trying to re-install openmpi-bin the system detected it was already installed issuing the message 'openmpi-bin is already the newest version (4.1.2-2ubuntu1)' but did not detect alternatives, outputing as before:

Setting up libhdf5-openmpi-dev (1.10.7+repack-4ubuntu2) ...
update-alternatives: error: no alternatives for mpi
dpkg: error processing package libhdf5-openmpi-dev (--configure):
installed libhdf5-openmpi-dev package post-installation script subprocess returned error
exit status 2
Errors were encountered while processing:
libhdf5-openmpi-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)

I finally solved the problem using the Synaptic package manager: Package / Mark for Complete Removal. Then installed openmpi-bin again and after that I found the above mentioned mpi* files that are expected to exist on Ubuntu 22.04 and all my packages are working correctly now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.