Score:1

Install specific package version through meta-package

in flag

I have a meta-package for tensorrt which is just a list of dependencies to specific versions of libraries. Here is the control file of it:

Package: tensorrt
Source: tensorrt (7.1.3-1+cuda10.2)
Version: 7.1.3.4-1+cuda10.2
Architecture: amd64
Maintainer: cudatools <[email protected]>
Installed-Size: 11
Depends: libnvinfer7 (= 7.1.3-1+cuda10.2), libnvinfer-plugin7 (= 7.1.3-1+cuda10.2), libnvparsers7 (= 7.1.3-1+cuda10.2), libnvonnxparsers7 (= 7.1.3-1+cuda10.2), libnvinfer-bin (= 7.1.3-1+cud
a10.2), libnvinfer-dev (= 7.1.3-1+cuda10.2), libnvinfer-plugin-dev (= 7.1.3-1+cuda10.2), libnvparsers-dev (= 7.1.3-1+cuda10.2), libnvonnxparsers-dev (= 7.1.3-1+cuda10.2), libnvinfer-samples
 (= 7.1.3-1+cuda10.2), libnvinfer-doc (= 7.1.3-1+cuda10.2)
Section: multiverse/devel
Priority: optional
Description: Meta package of TensorRT
 Meta package of TensorRT.

Now, when I want to install tensorrt it says:

The following packages have unmet dependencies:
 tensorrt : Depends: libnvinfer-dev (= 7.1.3-1+cuda10.2) but 8.0.3-1+cuda11.3 is to be installed
            Depends: libnvinfer-plugin-dev (= 7.1.3-1+cuda10.2) but 8.0.3-1+cuda11.3 is to be installed
            Depends: libnvparsers-dev (= 7.1.3-1+cuda10.2) but 8.0.3-1+cuda11.3 is to be installed
            Depends: libnvonnxparsers-dev (= 7.1.3-1+cuda10.2) but 8.0.3-1+cuda11.3 is to be installed
            Depends: libnvinfer-samples (= 7.1.3-1+cuda10.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

If we take a specific lib, for example libnvinfer-dev, according to apt-cache policy, I have several versions of it available:

(ubuntu-xenial-amd64)svc_moma_usr@PL1LXD-529389:/$ apt-cache policy libnvinfer-dev
libnvinfer-dev:
  Installed: 7.1.3-1+cuda10.2
  Candidate: 8.0.3-1+cuda11.3
  Version table:
     8.0.3-1+cuda11.3 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
     8.0.3-1+cuda10.2 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
     8.0.1-1+cuda11.3 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
     8.0.1-1+cuda10.2 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
     8.0.0-1+cuda11.3 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
     8.0.0-1+cuda11.0 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
     8.0.0-1+cuda10.2 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
 *** 7.1.3-1+cuda10.2 500
        500 https://repository.ttgroup.com/repository/rozbad-xenial xenial/main amd64 Packages
        100 /var/lib/dpkg/status
     7.0.0-1+cuda10.2 500
        500 file:/var/nv-tensorrt-repo-cuda10.2-trt7.0.0.11-ga-20191216  Packages
        500 https://repository.ttgroup.com/repository/rozbad-xenial xenial/main amd64 Packages

As you can see, I managed to install the version I want explicitly with apt install libnvinfer-dev=7.1.3-1+cuda-10.2, even though the version is older, but installing this version is not possible through tensorrt meta-package, although the older versions are also explicitely stated there. How can I make APT install this package?

I know that it is possible to change the priorities in /etc/apt/preferences.d, but this is done on the system level, while I want to tell APT to install these packages through the control file.

muru avatar
us flag
You can't, not just using your meta package's dependency settings
Piotr G avatar
in flag
How about some workaround? For example, I know I can install the dependencies manually with a specific version. When in the debian package files (control. rules, etc) I could add bash command in which I install the packages, and not with the dependency resolution mechanism.
muru avatar
us flag
That won't work either, since the package management system is locked while an installation is in progress, so installation commands in the maintainer scripts will fail. You can provide a script to install your package which can then do things like `apt-get install meta-pkg=x.y dep1=a.b dep2=c.d`, etc., or put all dependencies in your repo and add that repo with a high pin priority.
Piotr G avatar
in flag
Thanks. But I could run the bash commands containing `apt-get ...` before the installation. I didn't mention this originally, but I need to install `tensorrt` to build another package using `sbuild` and installation of `tensorrt` was triggered from `debian/control`. Maybe I could run these `apt-get` commands before installation of tensorrt is triggered, but I am not quite sure about the order in which `sbuild` steps are run. My idea was to override sth. in `debian/rules`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.