Skip to content
Blog How to add repository keys in ubuntu

How to add repository keys in ubuntu

  • Download the gpg keys for the repositories and automatically add them to your repository keyring:
  • Example: To obtain and add the Medibuntu repository key:
wget --quiet http://packages.medibuntu.org/medibuntu-key.gpg -O - | sudo apt-key add -
  • Example: To obtain and add the Google repository key:
wget --quiet http://dl.google.com/linux/linux_signing_key.pub -O - | sudo apt-key add -

Note: wget – retrieves a file from a network location. –quiet = no output. -O = Output downloaded item to terminal. The | (pipe symbol) is used to capture the output from the previous command (in our case the screen) and use it as an input for the piped command (i.e. apt-key, which adds it to the keyring).

  • Alternatively (and perhaps more easily), you can use apt-key directly:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY
where KEY is the missing key code printed in apt-get output, e.g. EF4186FE247510BE.
Note: Key servers often use port 11371. Make sure your firewall allows port 11371 to be open.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.