无法为 Ubuntu 22.04.2 LTS x86_64 安装 build-dep

无法为 Ubuntu 22.04.2 LTS x86_64 安装 build-dep

我使用的是 22.04.2。为什么选择 linux-signed-hwe-5.19 而不是当前安装的内核版本?这造成的影响是,当我使用修改后的源代码更新目标内核时,由于存在冲突,因此无法下载任何软件包。如有任何建议,我将不胜感激。

alex@alex-Virtual-Machine:~$ sudo apt build-dep linux linux-image-$(uname -r)
    Reading package lists... Done'
    Picking 'linux-signed-hwe-5.19' as source package instead of 'linux-image-5.19.0-40-generic'
    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:
 builddeps:linux-signed-hwe-5.19 : Depends: linux-image-unsigned-5.19.0-40-generic (= 5.19.0-40.41~22.04.1) but it is not going to be installed
                                   Depends: linux-generate-hwe-5.19 (= 5.19.0-40.41~22.04.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
    
alex@alex-Virtual-Machine:~$ uname -mrs
    Linux 5.19.0-40-generic x86_64
    
alex@alex-Virtual-Machine:~$ apt policy build-essential
    build-essential:
      Installed: 12.9ubuntu3
      Candidate: 12.9ubuntu3
      Version table:
     *** 12.9ubuntu3 500
            500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
            100 /var/lib/dpkg/status

答案1

请尝试以下解决方法

sudo apt-get build-dep linux linux-image-unsigned-$(uname -r)

“-unsigned” 是额外添加的。最初在这里回答:https://stackoverflow.com/questions/75695258/how-to-fix-broken-packages-of-linux-unsigned-image

相关内容