1

This is a follow up question on Cross-compile for armhf and install a static library

In the accepted answer following is mentioned at the end,

Clarification: Multiarch packages need to be installed with the same version on all architectures. So, you should have libudev-dev:armhf with version 229-4ubuntu21.4, but your current repository configuration does not include this version. So, you should add the line with xenial-updates where this version is supported.

I want to know how exactly I can do following?

So, you should add the line with xenial-updates where this version is supported.

I am new to this so elaborated answer with examples will be helpful.

Update 1 (trials as per comments )

with sources.list shown below I tried "apt-cache policy libudev-dev:{amd64,armhf}" its output is shown below. Error of "sudo apt install libudev-dev:armhf" is below.

sources.list file contents

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

output of 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

output of 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.

Update 2

Tried with following in 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

still getting error as below for 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.

Update -3

Tried with following sources.list but no use, problem not solved yet

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

Ajey
  • 11

1 Answers1

1

The OP in that question edited it to include this:

apt-cache policy libudev-dev:{amd64,armhf} outputs the following:

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

Note that the "candidate" versions for both architectures are different, since the xenial-updates and xenial-security repositories have newer versions for amd64, but not for armhf.

@psiphi75 is saying that you should install the exact same version for both architectures, so including xenial-updates will cause a mismatch (as will xenial-security though). So their suggestion is to not include it in sources.list (modifying step 4 in their answer), and then install libudev-dev for both architectures.

However, according to the packages index, libudev-dev now has the following version for the following architectures in xenial-updates:

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

So, since the same version is now available for both amd64 and armhf in xenial-updates, you can include it in sources.list.

muru
  • 197,895
  • 55
  • 485
  • 740
  • Tried few options for sources.list but could not get it working. Can you please help me with correct contents of sources.list for current situation of packages. – Ajey Jan 21 '21 at 04:31
  • @Ajey examine your output for apt-cache policy libudev-dev:{amd64,armhf} - check if the candidate versions match. If they don't, then look at the list of versions for both and only include the repositories for which you get the same version. – muru Jan 21 '21 at 04:36
  • Please see Imgur with sources.list shown in the image I tried "apt-cache policy libudev-dev:{amd64,armhf}" its output is shown in the image. Error of "sudo apt install libudev-dev:armhf" is also shown in the image. – Ajey Jan 21 '21 at 05:03
  • Yeah, don't post screenshots of text. Edit your question, copy the text there and use code formatting: https://askubuntu.com/editing-help#code – muru Jan 21 '21 at 05:04
  • I have now added contents in the question, please have a look. – Ajey Jan 21 '21 at 05:17