hskwnb@hskwnb-MS-7D76:~$ sudo apt install libopenmpi-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:
下列软件包有未满足的依赖关系:
libevent-core-2.1-7t64 : 破坏: libevent-core-2.1-7 (< 2.1.12-stable-9ubuntu2)
libevent-pthreads-2.1-7t64 : 破坏: libevent-pthreads-2.1-7 (< 2.1.12-stable-9ubuntu2)
libhwloc-dev : 依赖: libhwloc15 (= 2.1.0+dfsg-4) 但是 2.10.0-1build1 正要被安装
依赖: libnuma-dev 但是它将不会被安装
依赖: libltdl-dev 但是它将不会被安装
libibverbs-dev : 依赖: ibverbs-providers (= 28.0-1ubuntu1) 但是 50.0-2ubuntu0.2 正要被安装
依赖: libibverbs1 (= 28.0-1ubuntu1) 但是 50.0-2ubuntu0.2 正要被安装
依赖: libnl-3-dev 但是它将不会被安装
依赖: libnl-route-3-dev 但是它将不会被安装
libopenmpi3t64 : 破坏: libopenmpi3 (< 4.1.6-7ubuntu2)
openmpi-bin : 破坏: libopenmpi-dev (< 4.0.5-3) 但是 4.0.3-0ubuntu1 正要被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
最近新装了个ubuntu24.04,通过apt安装一些库的时候频繁出现这类情况,网上各类解决办法尝试均无效,直到换源。需要注意的是,换源前先看看那個源是否对应自己的版本的codename:
查看版本codename命令,这里可以看到24.04的codename为noble。
hskwnb@hskwnb-MS-7D76:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble
那么选择源时注意这里(这里以阿里云举例):
deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
将原有的源备份:
sudo cp /etc/apt/sources.list /etc/apt/sources.backup
然后对sources.list文件修改为上述内容,并更新即可
sudo apt update
谨以次帖纪念我浪费的1h。
1207

被折叠的 条评论
为什么被折叠?



