How to Fix Docker GPG Key Installation Errors on Ubuntu
In this blog post, we’ll walk you through the process of fixing gpg: no valid OpenPGP data found
error and get you back to smooth sailing with Docker.
Issue Overview
- Add the official Docker GPG key:
1 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
- Some users might encounter the following issue:
1 | $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
Step-by-Step Solutions
Here’s the solution I personally tested and found effective for a successful installation:
- First, download the official GPG key to your local machine. This will save the file as a
.gpg
file. The URL is:
1 | https://download.docker.com/linux/ubuntu/gpg |
- Once downloaded, use the following command to install the GPG key:
1 | sudo apt-key add /home/johnson/downloads/gpg |
- Note:
/home/johnson/downloads/gpg
is the file path to the GPG file on my Ubuntu system. Make sure to replace it with your own file path.
With this solution, you should be able to resolve the issue and complete the installation perfectly!
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.