目录

apt-get中Unmet Dependencies问题

目录

apt-get install 时无法自动安装相关依赖,导致报错,常见报错为:

1
2
3
4
5
6
7
8
9
$ sudo apt-get install libsctp-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libsctp-dev : Depends: libsctp1 (= 1.0.16+dfsg-3) but it is not going to be installed
 linux-headers-5.11.16-051116-generic : Depends: libssl1.1 (>= 1.1.0) but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

根据提示解决就好了:

1
sudo apt-get -f install

如果看到提示有包不需要了,可以执行移除,根据提示执行sudo apt autoremove

1
2
3
4
5
6
7
8
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-204 linux-headers-4.4.0-204-generic linux-image-4.4.0-204-generic linux-modules-4.4.0-204-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

参考:

apt-get 安装没有自动依赖 - harmful - 博客园

如何解决apt-get中Unmet dependencies问题_Bob Liu的程序人生-CSDN博客