Packaging for cuda-keyring
- Install GPG public key in
/usr/share/keyrings/
- Set repository priority with apt pinning
- Enable Nvidia's CUDA repository with
.list
forapt-get
deb [signed-by=/path/to/keyring] https://$repositoryURL $suite
ex:
debian11/x86_64
deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/ /
https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
- cuda-keyring
The apt-key
command is deprecated in Debian 12, Ubuntu 21.10 and derivative distros.
NVIDIA provides the repo GPG keys in both *.pub
and encapsulated keyring formats.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-archive-keyring.gpg
OR
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/$shortname.pub
cat $shortname.pub | gpg --dearmor > cuda-archive.keyring.gpg
note: replace
$shortname
with3bf863cc
Repositories maintained by different organizations may contain packages with the same name.
To ensure apt
selects software from one repository over another, priority pinning may be used.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
mv cuda-ubuntu2204.pin cuda.pin
cat cuda.pin
Package: nsight-compute
Pin: origin *ubuntu.com*
Pin-Priority: -1
Package: nsight-systems
Pin: origin *ubuntu.com*
Pin-Priority: -1
Package: *
Pin: release l=NVIDIA CUDA
Pin-Priority: 600
note: these are only needed for building not installation
apt-get install debhelper devscripts dpkg-dev make
usage: build.sh <keyring.gpg> [priority.pin]
DISTRO=[ubuntu2204|ubuntu2004] ARCH=[x86_64|sbsa|arm64] build.sh
DISTRO=[ubuntu2204|ubuntu2004] ARCH=[cross-linux-sbsa|cross-linux-aarch64] build.sh
DISTRO=[ubuntu1804|ubuntu1604] ARCH=[x86_64|ppc64el|sbsa] build.sh
DISTRO=[debian11|debian10|wsl-ubuntu] ARCH=x86_64 build.sh
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-archive-keyring.gpg
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
mv cuda-ubuntu2204.pin cuda.pin
DISTRO=ubuntu2204 ARCH=x86_64 ./build.sh cuda-archive-keyring.gpg cuda.pin
ls cuda-keyring*_all.deb
sudo dpkg --install cuda-keyring*_all.deb
sudo apt-get update
See CONTRIBUTING.md