how to change the default keyserver used by the command: “sudo add-apt-repository …”

Tested on linux mint 15.

If you encountered problems with connecting to keyserver.ubuntu.com when adding a new ppa to your list of repositories using add-apt-repository, i.e.: “sudo add-apt-repository ppa:jon-severinsson/ffmpeg”
Here’s an example failure:

....
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.UsuIhHAgLO --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys CFCA9579
gpg: requesting key CFCA9579 from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

Then what you have to do is to change the default port used for obtaining pgp keys from 11371 to 80.
To do this edit:

sudo vi /usr/lib/linuxmint/mintSources/mintSources.py

and replace all the occurrences of “keyserver.ubuntu.com” with

hkp://keyserver.ubuntu.com:80

after that,……
simply enjoy the rest of your life!

One thought on “how to change the default keyserver used by the command: “sudo add-apt-repository …”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s