How to add a GPG key to the apt sources keyring? Announcing the arrival of Valued Associate...

Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

How much radiation do nuclear physics experiments expose researchers to nowadays?

Were Kohanim forbidden from serving in King David's army?

ListPlot join points by nearest neighbor rather than order

How can players work together to take actions that are otherwise impossible?

Is there a concise way to say "all of the X, one of each"?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?

Why aren't air breathing engines used as small first stages

What do you call a phrase that's not an idiom yet?

I need to find the potential function of a vector field.

How to bypass password on Windows XP account?

How to find all the available tools in macOS terminal?

What is a Meta algorithm?

iPhone Wallpaper?

Bonus calculation: Am I making a mountain out of a molehill?

What would be the ideal power source for a cybernetic eye?

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

Does surprise arrest existing movement?

Do I really need recursive chmod to restrict access to a folder?

Should I discuss the type of campaign with my players?

Using et al. for a last / senior author rather than for a first author

How to do this path/lattice with tikz

Gastric acid as a weapon



How to add a GPG key to the apt sources keyring?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Failed writing body while installing SqlWhat is the correct way to completely remove an application?How can I remove gpg key that I added using apt-key add -?What is a terminal and how do I open and use it?wget | apt key add problemAdding repositorysudo: unable to resolve host architectHow do you install opera on Ubuntu (13.04 32 bit)?GPG Error while running apt-getDistributing your software professionally in Ubuntu?key import with apt-add-repository and own repository possible?Translation - “Adding the key to the list of trusted software vendors failed”Why does add-apt-repository now fail to retrieve keys behind my proxy server, but I can update package lists and manually receive the keys?apt-key add <file>; apt-get … keyserver timeout on same keyHow can I get GPG Agent to cache my password?Error: gpg: no valid OpenPGP data found while installing Filezillaopenprinting key for ubuntu 18Retrieving gpg Key timed out - What does this mean?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







59















Ubuntu Doc page says this:




It is advisable that you add the Opera GPG key.



wget -qO - http://deb.opera.com/archive.key | sudo apt-key add -




Where do I add that?



I want to take the advice but I don't know what part of software center to add gpg keys to.










share|improve this question




















  • 3





    I believe that is a one line command to enter into terminal

    – Mateo
    May 5 '13 at 13:55






  • 1





    .msi in Ubuntu is called .deb.

    – Alvar
    May 5 '13 at 17:12






  • 3





    As a side note, adding keys you fetch over non-HTTPS breaks any security that signing packages added. Wherever possible, you should download keys over a secure channel (https://).

    – user304335
    Jul 10 '14 at 18:00


















59















Ubuntu Doc page says this:




It is advisable that you add the Opera GPG key.



wget -qO - http://deb.opera.com/archive.key | sudo apt-key add -




Where do I add that?



I want to take the advice but I don't know what part of software center to add gpg keys to.










share|improve this question




















  • 3





    I believe that is a one line command to enter into terminal

    – Mateo
    May 5 '13 at 13:55






  • 1





    .msi in Ubuntu is called .deb.

    – Alvar
    May 5 '13 at 17:12






  • 3





    As a side note, adding keys you fetch over non-HTTPS breaks any security that signing packages added. Wherever possible, you should download keys over a secure channel (https://).

    – user304335
    Jul 10 '14 at 18:00














59












59








59


26






Ubuntu Doc page says this:




It is advisable that you add the Opera GPG key.



wget -qO - http://deb.opera.com/archive.key | sudo apt-key add -




Where do I add that?



I want to take the advice but I don't know what part of software center to add gpg keys to.










share|improve this question
















Ubuntu Doc page says this:




It is advisable that you add the Opera GPG key.



wget -qO - http://deb.opera.com/archive.key | sudo apt-key add -




Where do I add that?



I want to take the advice but I don't know what part of software center to add gpg keys to.







apt gnupg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 23 '14 at 19:28









Mateo

7,42385073




7,42385073










asked May 5 '13 at 13:51









brucebruce

89751319




89751319








  • 3





    I believe that is a one line command to enter into terminal

    – Mateo
    May 5 '13 at 13:55






  • 1





    .msi in Ubuntu is called .deb.

    – Alvar
    May 5 '13 at 17:12






  • 3





    As a side note, adding keys you fetch over non-HTTPS breaks any security that signing packages added. Wherever possible, you should download keys over a secure channel (https://).

    – user304335
    Jul 10 '14 at 18:00














  • 3





    I believe that is a one line command to enter into terminal

    – Mateo
    May 5 '13 at 13:55






  • 1





    .msi in Ubuntu is called .deb.

    – Alvar
    May 5 '13 at 17:12






  • 3





    As a side note, adding keys you fetch over non-HTTPS breaks any security that signing packages added. Wherever possible, you should download keys over a secure channel (https://).

    – user304335
    Jul 10 '14 at 18:00








3




3





I believe that is a one line command to enter into terminal

– Mateo
May 5 '13 at 13:55





I believe that is a one line command to enter into terminal

– Mateo
May 5 '13 at 13:55




1




1





.msi in Ubuntu is called .deb.

– Alvar
May 5 '13 at 17:12





.msi in Ubuntu is called .deb.

– Alvar
May 5 '13 at 17:12




3




3





As a side note, adding keys you fetch over non-HTTPS breaks any security that signing packages added. Wherever possible, you should download keys over a secure channel (https://).

– user304335
Jul 10 '14 at 18:00





As a side note, adding keys you fetch over non-HTTPS breaks any security that signing packages added. Wherever possible, you should download keys over a secure channel (https://).

– user304335
Jul 10 '14 at 18:00










4 Answers
4






active

oldest

votes


















77














This a a one line command to enter in terminal. See
What is a terminal and how do I open and use it?



To use it, you would paste the entire command in the terminal (remember to use https):



wget -qO - https://deb.opera.com/archive.key | sudo apt-key add -


But of course, it is daunting just copying and pasting commands without knowing what they are doing, and having no instructions on how to undo their actions, so here is a basic breakdown of the commands:





  • wget downloads something from a server. See wget manual for Ubuntu 16.04.


  • | is a pipline, which takes the output of one command and runs it into the input of another


  • apt-key add adds a package key


So it basically downloads the key and then adds it in one command.



I tested the command and it should work.





Now to verify that it worked, run this command (from this answer):



apt-key list


This will list the keys added and the key from Opera should be listed on the bottom like this:



pub   1024D/30C18A2B 2012-10-29 [expires: 2014-10-29]
uid Opera Software Archive Automatic Signing Key 2013 <packager@opera.com>
sub 4096g/C528FCA9 2012-10-29 [expires: 2014-10-29]


The linked answer also shows that you can remove the key if needed, using:



sudo apt-key del 30C18A2B


with 30C18A2B being the key-id from the list.





After performing that command, and setting up the sources exactly like in your screen-shot, do:



sudo apt-get update
sudo apt-get install opera


(note there are some random warnings, but nothing that affects the install or software center operations)



And for the removal (just in case): What is the correct way to completely remove an application?





So in summary:




  • Add repository
    enter image description here

  • Add key with apt-key

  • Install in terminal with apt-get

  • Search in dash
    enter image description here






share|improve this answer





















  • 4





    "apt-key adv" allows one to download the key from a public keyserver.

    – jeremiah
    Mar 31 '16 at 13:27











  • After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

    – Cerran
    Mar 17 '18 at 20:52






  • 2





    @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

    – Alexis Wilke
    Feb 27 at 18:36





















19














Newer versions of apt also support the following:



apt-key adv --fetch-keys http://deb.opera.com/archive.key


This method also provides more detailed feedback as well, e.g.:



gpg: key 7BD9BF62: public key "signing key <username@domain.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)


This also has the added bonus of removing the need for additional dependencies like wget or curl.






share|improve this answer



















  • 1





    apt-key adv does not seem to work for https

    – dani-h
    Jun 14 '17 at 11:24






  • 5





    @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

    – Tao Wang
    Oct 27 '17 at 5:08











  • apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

    – Tao Wang
    Oct 27 '17 at 5:11











  • It seems to work with https already (just tested on Ubuntu 17.10)

    – user1182474
    Dec 9 '18 at 19:25



















19














If you are manually adding a key from a PPA, use



sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 00000000


Replacing the 00000000 with the second part of the key informed in the PPA website that you want to add.



For example, if you find this line:



 4096R/7BF576066


Use only the second part (no matter its size), which in this example is 7BF576066






share|improve this answer
























  • are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

    – iuridiniz
    Dec 31 '18 at 13:49













  • No, errors like these aren't common. Maybe you're writing the wrong key.

    – Paulo Coghi
    Jan 1 at 14:51



















0














Another way where you just have an .asc key, you download the .asc key and add it to the keyring.



For instance -



curl -L https://packages.riot.im/debian/repo-key.asc | sudo apt-key add -




share








New contributor




shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f291035%2fhow-to-add-a-gpg-key-to-the-apt-sources-keyring%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    77














    This a a one line command to enter in terminal. See
    What is a terminal and how do I open and use it?



    To use it, you would paste the entire command in the terminal (remember to use https):



    wget -qO - https://deb.opera.com/archive.key | sudo apt-key add -


    But of course, it is daunting just copying and pasting commands without knowing what they are doing, and having no instructions on how to undo their actions, so here is a basic breakdown of the commands:





    • wget downloads something from a server. See wget manual for Ubuntu 16.04.


    • | is a pipline, which takes the output of one command and runs it into the input of another


    • apt-key add adds a package key


    So it basically downloads the key and then adds it in one command.



    I tested the command and it should work.





    Now to verify that it worked, run this command (from this answer):



    apt-key list


    This will list the keys added and the key from Opera should be listed on the bottom like this:



    pub   1024D/30C18A2B 2012-10-29 [expires: 2014-10-29]
    uid Opera Software Archive Automatic Signing Key 2013 <packager@opera.com>
    sub 4096g/C528FCA9 2012-10-29 [expires: 2014-10-29]


    The linked answer also shows that you can remove the key if needed, using:



    sudo apt-key del 30C18A2B


    with 30C18A2B being the key-id from the list.





    After performing that command, and setting up the sources exactly like in your screen-shot, do:



    sudo apt-get update
    sudo apt-get install opera


    (note there are some random warnings, but nothing that affects the install or software center operations)



    And for the removal (just in case): What is the correct way to completely remove an application?





    So in summary:




    • Add repository
      enter image description here

    • Add key with apt-key

    • Install in terminal with apt-get

    • Search in dash
      enter image description here






    share|improve this answer





















    • 4





      "apt-key adv" allows one to download the key from a public keyserver.

      – jeremiah
      Mar 31 '16 at 13:27











    • After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

      – Cerran
      Mar 17 '18 at 20:52






    • 2





      @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

      – Alexis Wilke
      Feb 27 at 18:36


















    77














    This a a one line command to enter in terminal. See
    What is a terminal and how do I open and use it?



    To use it, you would paste the entire command in the terminal (remember to use https):



    wget -qO - https://deb.opera.com/archive.key | sudo apt-key add -


    But of course, it is daunting just copying and pasting commands without knowing what they are doing, and having no instructions on how to undo their actions, so here is a basic breakdown of the commands:





    • wget downloads something from a server. See wget manual for Ubuntu 16.04.


    • | is a pipline, which takes the output of one command and runs it into the input of another


    • apt-key add adds a package key


    So it basically downloads the key and then adds it in one command.



    I tested the command and it should work.





    Now to verify that it worked, run this command (from this answer):



    apt-key list


    This will list the keys added and the key from Opera should be listed on the bottom like this:



    pub   1024D/30C18A2B 2012-10-29 [expires: 2014-10-29]
    uid Opera Software Archive Automatic Signing Key 2013 <packager@opera.com>
    sub 4096g/C528FCA9 2012-10-29 [expires: 2014-10-29]


    The linked answer also shows that you can remove the key if needed, using:



    sudo apt-key del 30C18A2B


    with 30C18A2B being the key-id from the list.





    After performing that command, and setting up the sources exactly like in your screen-shot, do:



    sudo apt-get update
    sudo apt-get install opera


    (note there are some random warnings, but nothing that affects the install or software center operations)



    And for the removal (just in case): What is the correct way to completely remove an application?





    So in summary:




    • Add repository
      enter image description here

    • Add key with apt-key

    • Install in terminal with apt-get

    • Search in dash
      enter image description here






    share|improve this answer





















    • 4





      "apt-key adv" allows one to download the key from a public keyserver.

      – jeremiah
      Mar 31 '16 at 13:27











    • After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

      – Cerran
      Mar 17 '18 at 20:52






    • 2





      @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

      – Alexis Wilke
      Feb 27 at 18:36
















    77












    77








    77







    This a a one line command to enter in terminal. See
    What is a terminal and how do I open and use it?



    To use it, you would paste the entire command in the terminal (remember to use https):



    wget -qO - https://deb.opera.com/archive.key | sudo apt-key add -


    But of course, it is daunting just copying and pasting commands without knowing what they are doing, and having no instructions on how to undo their actions, so here is a basic breakdown of the commands:





    • wget downloads something from a server. See wget manual for Ubuntu 16.04.


    • | is a pipline, which takes the output of one command and runs it into the input of another


    • apt-key add adds a package key


    So it basically downloads the key and then adds it in one command.



    I tested the command and it should work.





    Now to verify that it worked, run this command (from this answer):



    apt-key list


    This will list the keys added and the key from Opera should be listed on the bottom like this:



    pub   1024D/30C18A2B 2012-10-29 [expires: 2014-10-29]
    uid Opera Software Archive Automatic Signing Key 2013 <packager@opera.com>
    sub 4096g/C528FCA9 2012-10-29 [expires: 2014-10-29]


    The linked answer also shows that you can remove the key if needed, using:



    sudo apt-key del 30C18A2B


    with 30C18A2B being the key-id from the list.





    After performing that command, and setting up the sources exactly like in your screen-shot, do:



    sudo apt-get update
    sudo apt-get install opera


    (note there are some random warnings, but nothing that affects the install or software center operations)



    And for the removal (just in case): What is the correct way to completely remove an application?





    So in summary:




    • Add repository
      enter image description here

    • Add key with apt-key

    • Install in terminal with apt-get

    • Search in dash
      enter image description here






    share|improve this answer















    This a a one line command to enter in terminal. See
    What is a terminal and how do I open and use it?



    To use it, you would paste the entire command in the terminal (remember to use https):



    wget -qO - https://deb.opera.com/archive.key | sudo apt-key add -


    But of course, it is daunting just copying and pasting commands without knowing what they are doing, and having no instructions on how to undo their actions, so here is a basic breakdown of the commands:





    • wget downloads something from a server. See wget manual for Ubuntu 16.04.


    • | is a pipline, which takes the output of one command and runs it into the input of another


    • apt-key add adds a package key


    So it basically downloads the key and then adds it in one command.



    I tested the command and it should work.





    Now to verify that it worked, run this command (from this answer):



    apt-key list


    This will list the keys added and the key from Opera should be listed on the bottom like this:



    pub   1024D/30C18A2B 2012-10-29 [expires: 2014-10-29]
    uid Opera Software Archive Automatic Signing Key 2013 <packager@opera.com>
    sub 4096g/C528FCA9 2012-10-29 [expires: 2014-10-29]


    The linked answer also shows that you can remove the key if needed, using:



    sudo apt-key del 30C18A2B


    with 30C18A2B being the key-id from the list.





    After performing that command, and setting up the sources exactly like in your screen-shot, do:



    sudo apt-get update
    sudo apt-get install opera


    (note there are some random warnings, but nothing that affects the install or software center operations)



    And for the removal (just in case): What is the correct way to completely remove an application?





    So in summary:




    • Add repository
      enter image description here

    • Add key with apt-key

    • Install in terminal with apt-get

    • Search in dash
      enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 13 '17 at 12:23









    Community

    1




    1










    answered May 5 '13 at 16:35









    MateoMateo

    7,42385073




    7,42385073








    • 4





      "apt-key adv" allows one to download the key from a public keyserver.

      – jeremiah
      Mar 31 '16 at 13:27











    • After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

      – Cerran
      Mar 17 '18 at 20:52






    • 2





      @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

      – Alexis Wilke
      Feb 27 at 18:36
















    • 4





      "apt-key adv" allows one to download the key from a public keyserver.

      – jeremiah
      Mar 31 '16 at 13:27











    • After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

      – Cerran
      Mar 17 '18 at 20:52






    • 2





      @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

      – Alexis Wilke
      Feb 27 at 18:36










    4




    4





    "apt-key adv" allows one to download the key from a public keyserver.

    – jeremiah
    Mar 31 '16 at 13:27





    "apt-key adv" allows one to download the key from a public keyserver.

    – jeremiah
    Mar 31 '16 at 13:27













    After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

    – Cerran
    Mar 17 '18 at 20:52





    After adding the key with apt-key add, the .key file (in this case, "archive.key") can be deleted without consequence, right? The key (the information, not the file) has already been added to a list somewhere, so the file should no longer be needed.

    – Cerran
    Mar 17 '18 at 20:52




    2




    2





    @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

    – Alexis Wilke
    Feb 27 at 18:36







    @Cerran, correct. APT keeps keys somewhere else (/etc/apt/trusted.gpg.d/ and /var/lib/apt/keyrings/ for example.)

    – Alexis Wilke
    Feb 27 at 18:36















    19














    Newer versions of apt also support the following:



    apt-key adv --fetch-keys http://deb.opera.com/archive.key


    This method also provides more detailed feedback as well, e.g.:



    gpg: key 7BD9BF62: public key "signing key <username@domain.com>" imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)


    This also has the added bonus of removing the need for additional dependencies like wget or curl.






    share|improve this answer



















    • 1





      apt-key adv does not seem to work for https

      – dani-h
      Jun 14 '17 at 11:24






    • 5





      @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

      – Tao Wang
      Oct 27 '17 at 5:08











    • apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

      – Tao Wang
      Oct 27 '17 at 5:11











    • It seems to work with https already (just tested on Ubuntu 17.10)

      – user1182474
      Dec 9 '18 at 19:25
















    19














    Newer versions of apt also support the following:



    apt-key adv --fetch-keys http://deb.opera.com/archive.key


    This method also provides more detailed feedback as well, e.g.:



    gpg: key 7BD9BF62: public key "signing key <username@domain.com>" imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)


    This also has the added bonus of removing the need for additional dependencies like wget or curl.






    share|improve this answer



















    • 1





      apt-key adv does not seem to work for https

      – dani-h
      Jun 14 '17 at 11:24






    • 5





      @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

      – Tao Wang
      Oct 27 '17 at 5:08











    • apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

      – Tao Wang
      Oct 27 '17 at 5:11











    • It seems to work with https already (just tested on Ubuntu 17.10)

      – user1182474
      Dec 9 '18 at 19:25














    19












    19








    19







    Newer versions of apt also support the following:



    apt-key adv --fetch-keys http://deb.opera.com/archive.key


    This method also provides more detailed feedback as well, e.g.:



    gpg: key 7BD9BF62: public key "signing key <username@domain.com>" imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)


    This also has the added bonus of removing the need for additional dependencies like wget or curl.






    share|improve this answer













    Newer versions of apt also support the following:



    apt-key adv --fetch-keys http://deb.opera.com/archive.key


    This method also provides more detailed feedback as well, e.g.:



    gpg: key 7BD9BF62: public key "signing key <username@domain.com>" imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)


    This also has the added bonus of removing the need for additional dependencies like wget or curl.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 28 '16 at 17:11









    Andrew OdriAndrew Odri

    29123




    29123








    • 1





      apt-key adv does not seem to work for https

      – dani-h
      Jun 14 '17 at 11:24






    • 5





      @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

      – Tao Wang
      Oct 27 '17 at 5:08











    • apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

      – Tao Wang
      Oct 27 '17 at 5:11











    • It seems to work with https already (just tested on Ubuntu 17.10)

      – user1182474
      Dec 9 '18 at 19:25














    • 1





      apt-key adv does not seem to work for https

      – dani-h
      Jun 14 '17 at 11:24






    • 5





      @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

      – Tao Wang
      Oct 27 '17 at 5:08











    • apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

      – Tao Wang
      Oct 27 '17 at 5:11











    • It seems to work with https already (just tested on Ubuntu 17.10)

      – user1182474
      Dec 9 '18 at 19:25








    1




    1





    apt-key adv does not seem to work for https

    – dani-h
    Jun 14 '17 at 11:24





    apt-key adv does not seem to work for https

    – dani-h
    Jun 14 '17 at 11:24




    5




    5





    @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

    – Tao Wang
    Oct 27 '17 at 5:08





    @dani-h You need gnupg-curl to use HTTPS if you are using GPG 1.x.

    – Tao Wang
    Oct 27 '17 at 5:08













    apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

    – Tao Wang
    Oct 27 '17 at 5:11





    apt-key adv --fetch-keys will only fetch one key from the URL, and if the URL contains multiple keys, please use wget | apt-key add instead.

    – Tao Wang
    Oct 27 '17 at 5:11













    It seems to work with https already (just tested on Ubuntu 17.10)

    – user1182474
    Dec 9 '18 at 19:25





    It seems to work with https already (just tested on Ubuntu 17.10)

    – user1182474
    Dec 9 '18 at 19:25











    19














    If you are manually adding a key from a PPA, use



    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 00000000


    Replacing the 00000000 with the second part of the key informed in the PPA website that you want to add.



    For example, if you find this line:



     4096R/7BF576066


    Use only the second part (no matter its size), which in this example is 7BF576066






    share|improve this answer
























    • are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

      – iuridiniz
      Dec 31 '18 at 13:49













    • No, errors like these aren't common. Maybe you're writing the wrong key.

      – Paulo Coghi
      Jan 1 at 14:51
















    19














    If you are manually adding a key from a PPA, use



    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 00000000


    Replacing the 00000000 with the second part of the key informed in the PPA website that you want to add.



    For example, if you find this line:



     4096R/7BF576066


    Use only the second part (no matter its size), which in this example is 7BF576066






    share|improve this answer
























    • are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

      – iuridiniz
      Dec 31 '18 at 13:49













    • No, errors like these aren't common. Maybe you're writing the wrong key.

      – Paulo Coghi
      Jan 1 at 14:51














    19












    19








    19







    If you are manually adding a key from a PPA, use



    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 00000000


    Replacing the 00000000 with the second part of the key informed in the PPA website that you want to add.



    For example, if you find this line:



     4096R/7BF576066


    Use only the second part (no matter its size), which in this example is 7BF576066






    share|improve this answer













    If you are manually adding a key from a PPA, use



    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 00000000


    Replacing the 00000000 with the second part of the key informed in the PPA website that you want to add.



    For example, if you find this line:



     4096R/7BF576066


    Use only the second part (no matter its size), which in this example is 7BF576066







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 11 '17 at 21:11









    Paulo CoghiPaulo Coghi

    74031639




    74031639













    • are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

      – iuridiniz
      Dec 31 '18 at 13:49













    • No, errors like these aren't common. Maybe you're writing the wrong key.

      – Paulo Coghi
      Jan 1 at 14:51



















    • are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

      – iuridiniz
      Dec 31 '18 at 13:49













    • No, errors like these aren't common. Maybe you're writing the wrong key.

      – Paulo Coghi
      Jan 1 at 14:51

















    are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

    – iuridiniz
    Dec 31 '18 at 13:49







    are errors like gpg: keyserver receive failed: No keyserver available and gpg: keyserver receive failed: Connection refused common?

    – iuridiniz
    Dec 31 '18 at 13:49















    No, errors like these aren't common. Maybe you're writing the wrong key.

    – Paulo Coghi
    Jan 1 at 14:51





    No, errors like these aren't common. Maybe you're writing the wrong key.

    – Paulo Coghi
    Jan 1 at 14:51











    0














    Another way where you just have an .asc key, you download the .asc key and add it to the keyring.



    For instance -



    curl -L https://packages.riot.im/debian/repo-key.asc | sudo apt-key add -




    share








    New contributor




    shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      Another way where you just have an .asc key, you download the .asc key and add it to the keyring.



      For instance -



      curl -L https://packages.riot.im/debian/repo-key.asc | sudo apt-key add -




      share








      New contributor




      shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        Another way where you just have an .asc key, you download the .asc key and add it to the keyring.



        For instance -



        curl -L https://packages.riot.im/debian/repo-key.asc | sudo apt-key add -




        share








        New contributor




        shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        Another way where you just have an .asc key, you download the .asc key and add it to the keyring.



        For instance -



        curl -L https://packages.riot.im/debian/repo-key.asc | sudo apt-key add -





        share








        New contributor




        shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.








        share


        share






        New contributor




        shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 7 mins ago









        shirishshirish

        1011




        1011




        New contributor




        shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        shirish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f291035%2fhow-to-add-a-gpg-key-to-the-apt-sources-keyring%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

            Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

            Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...