If you try to add an ubuntu PPA using add-apt-repository, e.g.:

sudo add-apt-repository ppa:webupd8team/java

And you get the following error:

gpg: keyring `/tmp/tmpG9Z_HY/secring.gpg' created  
gpg: keyring `/tmp/tmpG9Z_HY/pubring.gpg' created  
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com  
?: **keyserver.ubuntu.com: Connection refused**  
gpgkeys: HTTP fetch error 7: couldn't connect: Connection refused  
gpg: no valid OpenPGP data found.  
gpg: Total number processed: 0  
recv failed

You can still add it by using a different key server:

sudo add-apt-repository -k pool.sks-keyservers.net ppa:webupd8team/java

List of alternative servers (source):

  • pool.sks-keyservers.net
  • subkeys.pgp.net
  • pgp.mit.edu
  • keys.nayr.net
  • keys.gnupg.net
  • wwwkeys.XX.pgp.net - replace XX with your country code (fr, en, de… etc)