From ef47385f8a4f42cc0b1a401f8e3a0363ad63ff8a Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:57:18 -0800 Subject: [PATCH] Fix missing gnupg package issue during installing k8s gpg file process (#18158) ### Why I did it When try to install k8s gpg file, there reports an error. - "E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation curl: (23) Failed writing body". To fix error we need to install gunpg package. But apt-key add is going to be deprecated, mv the gpg file to /etc/apt/trusted.gpg.d/ directly ### How I did it Download k8s gpg file and put it in /etc/apt/trusted.gpg.d/ #### How to verify it We can install k8s gpg file successfully, but no gnupg package installed inside sonic image. --- build_debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index f2e7fd1538e3..207bc95a7142 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -273,7 +273,7 @@ install_kubernetes () { local ver="$1" sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \ https://packages.cloud.google.com/apt/doc/apt-key.gpg | \ - sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add - + sudo LANG=C chroot $FILESYSTEM_ROOT tee /etc/apt/trusted.gpg.d/kubernetes.asc ## Check out the sources list update matches current Debian version sudo cp files/image_config/kubernetes/kubernetes.list $FILESYSTEM_ROOT/etc/apt/sources.list.d/ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update