添加 xenial-updates 行

添加 xenial-updates 行

这是一个后续问题交叉编译 armhf 并安装静态库

在接受的答案中最后提到了以下内容,

说明:多架构软件包需要在所有架构上安装相同的版本。因此,您应该拥有版本 229-4ubuntu21.4 的 libudev-dev:armhf,但您当前的存储库配置不包含此版本。因此,您应该在支持此版本的位置添加 xenial-updates 行。

我想知道我究竟该如何做?

因此,您应该在支持此版本的位置添加 xenial-updates 行。

我对此很陌生,因此带有示例的详细答案将会很有帮助。

更新 1(根据评论进行试验)

使用下面显示的 sources.list,我尝试了“apt-cache policy libudev-dev:{amd64,armhf}”,其输出如下所示。“sudo apt install libudev-dev:armhf”的错误如下。

sources.list 文件内容

deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-updates main multiverse restricted universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports xenial-updates main multiverse restricted universe

apt-cache policy libudev-dev:{amd64,armhf} 的输出

root@ajey-HP-Laptop-15t-dy100:/etc/apt# apt-cache policy libudev-dev:{amd64,armhf}
libudev-dev:
Installed: (none)
Candidate: 229-4ubuntu21.29
Version table:
 229-4ubuntu21.29 500
    500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
libudev-dev:armhf:
Installed: (none)
Candidate: 229-4ubuntu21.29
Version table:
 229-4ubuntu21.29 500
    500 http://ports.ubuntu.com/ubuntu-ports xenial-updates/main armhf Packages

sudo apt install libudev-dev:armhf 的输出

Reading package lists... Done
Building dependency tree       
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:armhf : Depends: libacl1:armhf (>= 2.2.51-8) but it is not installable
                 Depends: libblkid1:armhf (>= 2.19.1) but it is not going to be installed
                 Depends: libc6:armhf (>= 2.17) but it is not going to be installed
                 Depends: libgcc1:armhf (>= 1:3.5) but it is not installable
                 Depends: libkmod2:armhf (>= 5~) but it is not going to be installed
                 Depends: libselinux1:armhf (>= 2.0.65) but it is not installable
                 Depends: libudev1:armhf (= 229-4ubuntu21.29) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

更新 2

在 sources.list 中尝试以下操作

deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main multiverse restricted universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main multiverse restricted universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security main multiverse restricted universe

使用 sudo apt install libudev-dev:armhf 仍然会出现以下错误

Reading package lists... Done
Building dependency tree       
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:armhf : Depends: libacl1:armhf (>= 2.2.51-8) but it is not going to be installed
                 Depends: libblkid1:armhf (>= 2.19.1) but it is not going to be installed
                 Depends: libc6:armhf (>= 2.17) but it is not going to be installed
                 Depends: libgcc1:armhf (>= 1:3.5) but it is not going to be installed
                 Depends: libkmod2:armhf (>= 5~) but it is not going to be installed
                 Depends: libselinux1:armhf (>= 2.0.65) but it is not going to be installed
                 Depends: libudev1:armhf (= 229-4ubuntu21.29) but it is not going to be installed
E: Unable to correct problems, you have held broken packages. 

更新 -3

尝试了以下 sources.list 但无用,问题尚未解决

deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main multiverse restricted universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main multiverse restricted universe

deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main multiverse restricted universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates main multiverse restricted universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-security main multiverse restricted universe

deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-updates main multiverse restricted universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security main multiverse restricted universe

答案1

该问题中的 OP 对其进行了编辑,包括以下内容:

apt-cache policy libudev-dev:{amd64,armhf}输出以下内容:

libudev-dev:
  Installed: (none)
  Candidate: 229-4ubuntu21.4
  Version table:
     229-4ubuntu21.4 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     229-4ubuntu21.1 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     229-4ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libudev-dev:armhf:
  Installed: (none)
  Candidate: 229-4ubuntu4
  Version table:
     229-4ubuntu4 500
        500 http://ports.ubuntu.com/ubuntu-ports xenial/main armhf Packages

请注意,两种架构的“候选”版本是不同的,因为xenial-updatesxenial-security存储库有的较新版本amd64,但没有的较新版本armhf

@psiphi75 说您应该为两种架构安装完全相同的版本,因此包含xenial-updates会导致不匹配(尽管如此xenial-security)。因此他们的建议是不将其包含在内sources.list(修改其答案中的步骤 4),然后libudev-dev为两种架构安装。

然而, 根据软件包索引libudev-dev现在有适用于以下体系结构的以下版本xenial-updates

229-4ubuntu21.29: amd64 arm64 armhf i386 powerpc ppc64el s390x 

amd64因此,由于现在和armhf中均有相同的版本xenial-updates,因此您可以将其包含在 中sources.list

相关内容