I am installing a package called nvhpc
from a third party repository.
To do that I use the recommended method that consists on:
$ apt-get update && apt-get install --no-install-recommends -y --quiet ca-certificates
$ echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /'
$ apt-get update -y
$ apt-get install --no-install-recommends -y nvhpc-22-2
It turns out that this tries to install nvhpc-22-3
which is a newer version.
(I don't want to install it because, among other things, I don't have space in my virtual machine for both version).
It is also strange that if I install explicitly nvhpc-22-3
(or nvhpc
) it install only version 22.3, while if I ask for nvhpc-22-2
it will install both 22.2 and 22.3.
(22.3 or 22.2 alone should fit in the disk.)
I think the repository or apt-get
is trying to be smart and installing old and new versions.
How can I prevent the installation of the newer version? (that is, the package specifically called nvhpc-22-3
or nvhpc
)?
Note that I pass the argument --no-install-recommends
to prevent things like that, in case that is related.
This is the output for the last command above:
$ apt-get install --no-install-recommends -y nvhpc-22-2
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
nvhpc-22-2 nvhpc-22-3 perl ...
...
0 upgraded, 98 newly installed, 0 to remove and 14 not upgraded.
Need to get 5909 MB of archives.
After this operation, 20.5 GB of additional disk space will be used.
...
Selecting previously unselected package nvhpc-22-3.
Preparing to unpack .../94-nvhpc-22-3_22.3_amd64.deb ...
Unpacking nvhpc-22-3 (22.3) ...
Selecting previously unselected package nvhpc-2022.
Preparing to unpack .../95-nvhpc-2022_22.3_amd64.deb ...
Unpacking nvhpc-2022 (22.3) ...
Selecting previously unselected package nvhpc-22-2.
Preparing to unpack .../96-nvhpc-22-2_22.2_amd64.deb ...
Unpacking nvhpc-22-2 (22.2) ...
This is not a version issue. These are actually two different packages, not two different versions of the same package. It appears that
nvhpc-22-3
is a dependency ofnvhpc-22-2
.For whatever reason, they made it a dependency so you are going to have to install both packages. Most likely,
nvhpc-22-2
is not complete andnvhpc-22-3
contains some stuff needed fornvhpc-22-2
to be complete.In any case, each of these has a different name so questions about version number are irrelevant (you can't use typical methods of apt pinning to a specific version). You can contact the vendor if you don't feel this is necessary or if you want to find out why it is necessary.
You can verify this by running:
and this should show that
nvhpc-22-3
is a dependency. Apt is not intelligent beyond dependency issues and will not try to install packages that aren't dependencies, particularly when you use the--no-install-recommends
flag.Lastly, if you feel this is a bug, you can also file a bug report with the software vendor.