无法在 Ubuntu 22.04 上安装 libudev-dev

无法在 Ubuntu 22.04 上安装 libudev-dev
sudo apt install libudev-dev

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libudev-dev : Depends: libudev1 (= 249.11-0ubuntu3) but 249.11-0ubuntu3.4 is to be installed
E: Unable to correct problems, you have held broken packages.

我找不到任何解决方案。有些答案说“升级所有内容就可以了”,但我现在已经升级了(2 小时前),错误仍然存​​在。它说我保留了损坏的软件包,但sudo apt-mark showhold没有显示任何内容(空列表)。

我只需要安装libudev-dev,任何版本都可以。请提供建议,好吗?

apt policy libudev-dev && apt policy libudev1
libudev-dev:
  Installed: (none)
  Candidate: 249.11-0ubuntu3
  Version table:
     249.11-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libudev1:
  Installed: 249.11-0ubuntu3.4
  Candidate: 249.11-0ubuntu3.4
  Version table:
 *** 249.11-0ubuntu3.4 100
        100 /var/lib/dpkg/status
     249.11-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

这是我的cat /etc/apt/sources.list- 只有一行,这是按照建议删除此文件,运行“软件和更新”并勾选所有复选框后的结果:

cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu jammy main universe restricted multiverse

答案1

您已禁用jammy-updates存储库。

您对该文件的操作有误/etc/apt/sources.list

您可以通过删除它然后启用软件和更新中的所有存储库来恢复为默认值。

您还需要在“更新”选项卡中启用所有更新。

问题是jammy-updates之前启用的和包版本不匹配。

相关内容