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
.gpgfile. 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/gpgis 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!
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Johnson Lin!


