Retrieving gpg Key timed out - What does this mean?
I had the exact same problem that you've described. I found that sometimes repositories can behave as if censored by your internet service provider (it's quite weird). I solved this problem by using a VPN. It will work the minute you hit Enter. No wait, no fuss, smooth sailing. I hope it works for you. If you're not sure what VPN works on Linux, check out ProtonVPN. It's free and fast.
Related videos on Youtube

user3138170
Updated on September 18, 2022Comments
-
user3138170 3 months
I am unable to install any packages thru the terminal. After doing sudo add-apt-repository, the terminal seems to run normally (after about 5-10 minutes however) and am asked to hit enter. After I hit enter, I receive an error saying "Error: retrieving gpg key timed out.". Does anyone know what this error means and what I need to fix?
I see this question has been asked before on here but no answers unfortunately. Error: retrieving gpg key timed out
+Ubuntu 18.04 LTS
+Processor: Intel Core i5-4590 CPU @ 3.30GHz
+RAM: 8GB
-
SYGMAH over 3 yearsCheck you network config and hostname config. I've had strange hangs with APT-type things with a messed up hostname. More notably, "Timed Out" means in internet talk that your computer waited too long for the remote resource/server to respond, and it gave up instead of waiting indefinitely. Again, check network. Make sure your repos are configured correctly, too.
-
user3138170 over 3 yearsI was able to check my hostname with the terminal and the hosts and hostname files in the etc folder. There was a difference but I changed it back (the names in the two files and terminal match now) and am still getting the same error. What should I be looking for when I check my network config and repo configs?
-
SYGMAH over 3 yearsFirstly, open "Software and Updates" and review that the correct repos are in there, maybe try adding through that application if possible instead of from APT. Just look through, maybe show pictures or a list of all your repos if need be. For network, make sure your firewall isn't blocking that site, make sure you have any applicable proxies set up correctly, etc. and make sure your internet connection is working [completely] properly.
-
user3138170 over 3 yearsSoftware and Updates here and here. Sudo ufw status returns "Status: inactive". That is how to check the firewall correct? My internet is working normally as far as I can tell. Able to play chess online, stream music, upload pics etc. My network proxy is off/disabled.
-
SYGMAH over 3 yearsAh, a Mac themed system! Welcome to the club! Anyway, all looks normal from what I can tell on the repo side and the proxy sides. I'm not generally one to check firewalls and I generally meant if you are able to check the network itself, but showing inactive probably references the local firewall and it is good to know this is not interfering. If you own the network, perhaps verify you haven't got any firewall running on that interfering. Check to see that there is no antivirus running which might interfere with APT. I'm going to try the repo on my system and see if it's their server tomorrow.
-
user3138170 over 3 yearsThanks for the follow up. This is just my home network and haven't done anything to modify it. Meaning, the ISP installed their modem/router and that's what I've been using. I don't have any antivirus running. I only started using Ubuntu last weekend so still learning some things.
-
SYGMAH over 3 yearsI see. What's likely the case, then, is that they have a server issue that is causing this. I would check now to see if I get the same issue, but I unfortunately only have a Chromebook on me (sad) and my Ubuntu server is offline due to servicing. I'll be able to check on Monday at the soonest when I get back to where it's stored. If nothing happens by then, I'll be able to verify that it's a serverside issue if it happens on my end too.
-
user3138170 over 3 yearsThanks! Much appreciated. Not a life or death issue for me. Just trying to learn this linux and tech stuff to use Linux long term. Enjoy your weekend!
-
SYGMAH over 3 yearsWhat was the repo? I can try and put it into my end and see if it works now.
-
user3138170 over 3 yearsThis is one of the repos that was giving me the error. sudo add-apt-repository ppa:danielrichter2007/grub-customizer link to where I found it
-
SYGMAH over 3 yearsIt seemed to work for me, so it might be your network... Maybe try
sudo apt autoclean && sudo apt autoremove
to see if it's something on the local machine, as well as forgetting your network and logging back into it. -
user3138170 over 3 yearsI appreciate all your help. Unfortunately I'm still getting the error. I think I'm going to wipe Ubuntu from my hard drive and do a fresh install. I just don't know what else to do. I'm thinking I must have fudged something after I initially installed and started tweaking not knowing what I was doing. Again, thanks for the help.
-
SYGMAH over 3 yearsI would try installing (after doing
sudo apt update
) the repo from the live CD/USB you used to install, so you know if it's Ubuntu on the HDD or your network. The live CD/USB will not have any tweaks after a restart. Hopefully not too late. -
user3138170 over 3 yearsHa, I actually did try that and got the same error message. Anyway, I did end up doing the Ubuntu reinstall (didn't have anything important on it just saved the few docs I needed to a thumb drive). I'm now trying to teach myself some linux and terminal basics before installing and tweaking things. I also went out and bought an ethernet cord that I'm going to try using when I decide to install a PPA. Not sure it will make a difference since my wifi signal was fine but I guess it's worth a shot.
-
SYGMAH over 3 yearsCould be the WiFi, if you can do Ethernet you should, is my motto. I'm going to see if I can find a DEB for that program. You're looking for GRUB Customizer, right?
-
user3138170 over 3 yearsYes, the Grub customizer I linked to above was the one I was initially tried that gave me the error. I've tried other PPA's and all have returned the same error message. Here's another example. I also find it strange that despite the time out error, the PPA link ends up in my "Software and Updates" manager. See the neofetch ppa as an example. I'm with you re: Ethernet. Older home isn't wired for it but I'll work something out.
-
SYGMAH over 3 yearsIf you keep getting these errors on other repos, you might have a network problem after all. If it still ends up in your repository list, maybe it's just a recurring bug, though? Try
sudo apt update
and try installing from one of the repos.
-
-
nightwatch about 1 yearHad the same problem.. couldn't install packages.... I dropped my vpn and suddenly everything worked