Home > OS >  What commands (exactly) should replace the deprecated apt-key?
What commands (exactly) should replace the deprecated apt-key?

Time:09-30

I am trying to set up Kubernetes in my instance on a ubuntu 22.04 virtual machine. While in the installation process i am trying to add a gpg key for intra cluster communication. After running the command:

sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add

I got a message that apt-key add was deprecated and I should read the apt-key(8) man page. Can anyone tell me what exactly, I should type on my terminal instead of this!

CodePudding user response:

I share this link.

https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management

  1. Update the apt package index and install packages needed to use the Kubernetes apt repository:
sudo apt-get update
sudo apt-get install -y ca-certificates curl
  1. Download the Google Cloud public signing key:
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
  1. Add the Kubernetes apt repository:
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
  1. Update apt package index with the new repository and install kubectl:
sudo apt-get update
sudo apt-get install -y kubectl
  • Related