在 ubuntu 中无法使用 apt install 安装任何东西

在 ubuntu 中无法使用 apt install 安装任何东西

任何类似的请求sudo apt-get install ***都会启动安装过程,但在解压时会引发错误,之后一些软件包安装并正常工作,一些软件包不能正常工作,一些软件包没有显示为已安装。

dpkg: error processing package openmpi-bin (--configure):
 installed openmpi-bin package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of mpi-default-bin:
 mpi-default-bin depends on openmpi-bin; however:
  Package openmpi-bin is not configured yet.

dpkg: error processing package mpi-default-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libcoarrays-openmpi-dev:amd64:
 libcoarrays-openmpi-dev:amd64 depends on openmpi-bin; however:
  Package openmpi-bin is not configured yet.

dpkg: error processing package libcoarrays-openmpi-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopenmpi-dev:amd64:
 libopenmpi-dev:amd64 depends on openmpi-bin (>= 3.0.0-1); however:
  Package openmpi-bin is not configured yet.

dpkg: error processing package libopenmpi-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-mpi-python1.74.0:
 libboost-mpi-python1.74.0 depends on mpi-defauNo apport report written because the error message indicates it's a follow-up error from a previous failure.
           No apport report written because the error message indicates it's a follow-up error from a previous failure.
                                                                                                                       No apport report written because MaxReports has already been reached
                                           No apport report written because MaxReports has already been reached
                                                                                                               lt-bin; however:
  Package mpi-default-bin is not configured yet.

dpkg: error processing package libboost-mpi-python1.74.0 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-mpi-python1.74-dev:
 libboost-mpi-python1.74-dev depends on libboost-mpi-python1.74.0 (= 1.74.0-14ubuntu3); however:
  Package libboost-mpi-python1.74.0 is not configured yet.

dpkg: error processing package libboost-mpi-python1.74-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-mpi-python-dev:
 libboost-mpi-python-dev depends on libboost-mpi-python1.74-dev; however:
  Package libboost-mpi-python1.74-dev is not configured yet.

dpkg: error processing package libboost-mpi-python-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-all-dev:
 libboost-all-dev depends on libboost-mpi-python-dev; however:
  PackageNo apport report written because MaxReports has already been reached
                                                                             No apport report written because MaxReports has already been reached
 No apport report written because MaxReports has already been reached
                                                                      libboost-mpi-python-dev is not configured yet.

dpkg: error processing package libboost-all-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mpi-default-dev:
 mpi-default-dev depends on libopenmpi-dev; however:
  Package libopenmpi-dev:amd64 is not configured yet.

dpkg: error processing package mpi-default-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-mpi1.74-dev:
 libboost-mpi1.74-dev depends on mpi-default-dev; however:
  Package mpi-default-dev is not configured yet.

No apport report written because MaxReports has already been reached
                                                                    No apport report written because MaxReports has already been reached
                                                                                                                                        dpkg: error processing package libboost-mpi1.74-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libboost-mpi-dev:
 libboost-mpi-dev depends on libboost-mpi1.74-dev; however:
  Package libboost-mpi1.74-dev is not configured yet.

dpkg: error processing package libboost-mpi-dev (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports has already been reached
                                                                    Errors were encountered while processing:
 openmpi-bin
 mpi-default-bin
 libcoarrays-openmpi-dev:amd64
 libopenmpi-dev:amd64
 libboost-mpi-python1.74.0
 libboost-mpi-python1.74-dev
 libboost-mpi-python-dev
 libboost-all-dev
 mpi-default-dev
 libboost-mpi1.74-dev
 libboost-mpi-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试了以下操作:

sudo apt clean
sudo dpkg --configure -a
sudo apt -f install
sudo dpkg --remove --force-remove-reinstreq openmpi-bin
sudo apt update
sudo apt install openmpi-bin
sudo apt autoremove
sudo apt update && sudo apt upgrade

sudo dpkg --remove --force-remove-reinstreq openmpi-bin回答:

dpkg: dependency problems prevent removal of openmpi-bin:
 mpi-default-bin depends on openmpi-bin.
 libopenmpi-dev:amd64 depends on openmpi-bin (>= 3.0.0-1).
 libcoarrays-openmpi-dev:amd64 depends on openmpi-bin.

dpkg: error processing package openmpi-bin (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 openmpi-bin

这个答案来自也帮不了我。

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -f

我尝试了从 apt update 到重启的所有方法。我该怎么做才能消除此错误并正确安装软件包?

答案1

我刚刚遇到了同样的错误。我可以通过以下方式解决它:

sudo rm -f /etc/alternatives/mpi* /var/lib/dpkg/alternatives/mpi*
sudo rm /var/lib/dpkg/alternatives/mpi
sudo apt install openmpi-bin

然后我就可以安装我之前尝试安装的任何东西了(我的情况是 gparted)

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

相关内容