The Blog of Boban Acimovic
  • Blog
  • Categories
  • Tags
  • Series
  • Links
  • About
  • Contact
  • RSS
  • Terms
  • Privacy

Ubuntu

Carpe Diem

linux

How to install Docker and kubectl on Ubuntu 22.04 desktop

Since some time apt-key is deprecated and lot of Ubuntu 22.04 based systems throws the following warning:

Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details

You can easily fix this by properly installing Docker and Kubernetes apt archives public keys:

wget -qO - https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor | sudo dd of=/usr/share/keyrings/docker-archive-keyring.gpg

echo 'deb [ arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg ] https://download.docker.com/linux/ubuntu jammy stable' | sudo tee /etc/apt/sources.list.d/docker.list

wget -qO - https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor | sudo dd of=/usr/share/keyrings/kubernetes-archive-keyring.gpg

echo 'deb [ arch=amd64 signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg ] http://apt.kubernetes.io/ kubernetes-xenial main' | sudo tee /etc/apt/sources.list.d/kubernetes.list

Take a look at /etc/apt/sources.list.d and find out if there is also an old source definition and if you find it, just delete it, the new one will suffice. You can also find out if there are duplicates if you run sudo apt-get update. Just delete the old version which doesn’t contain signed-by inside.

  • Boban Acimovic
Boban Acimovic 18 March 2023 • 2 min read
The Blog of Boban Acimovic © 2023
Latest Posts