How to add a new repository AND its GPG key ?

General support questions including new installations
Post Reply
pstein
Posts: 87
Joined: 2008/11/26 21:34:55

How to add a new repository AND its GPG key ?

Post by pstein » 2011/02/14 16:56:32

Assume I want to add a new external Repository and its GPG key from terminal (in one cmd).

How do I do that in centOS?

In Ubuntu there is a command:

sudo add-apt-repository ppa:foobar/ppa

What is the corresponding command in CentOS?

How can I view the list of currently known Repositories of the local CentOS installation?

Peter

falcon1620
Posts: 22
Joined: 2009/06/29 19:23:16

Re: How to add a new repository AND its GPG key ?

Post by falcon1620 » 2011/02/14 17:18:05

Ok so here is a question I can answer! :-P

Usually when you want to add repositories you can just enter the command via rpm for example, if you wanted to add the RPM forge Repo, you'd enter this as the command.

[code]rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm[/code]

you can also import GPG keys by using for example...

[code]rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt[/code]

You can also set up software sources in the GUI, by going to Applications >> Add/Remove Software

and then in the Package Manager Window click on Edit >> Repos and manage them from there.

Also be sure to check out the CentOS Wiki, its a really great resource for questions like this and they have done a really nice job with documentation:

[url=http://wiki.centos.org/AdditionalResources/Repositories]http://wiki.centos.org/AdditionalResources/Repositories[/url]


:-D

pstein
Posts: 87
Joined: 2008/11/26 21:34:55

Re: How to add a new repository AND its GPG key ?

Post by pstein » 2011/02/15 09:07:08

Ok, thank you.

So there is no joined statement (like in Ubunut) of add-repository AND add-gpg ?


How do I list all currently locally known repositories?

Peter

markkuk
Posts: 739
Joined: 2007/09/07 10:56:28
Location: Finland

How to add a new repository AND its GPG key ?

Post by markkuk » 2011/02/15 12:42:01

[quote]
pstein wrote:
So there is no joined statement (like in Ubunut) of add-repository AND add-gpg ?[/quote]
If the repository provides a release RPM package, it normally contains both the repository definition file and the GPG key. Importing the key manually isn't required in that case.

[quote]
pstein wrote:
How do I list all currently locally known repositories?
[/quote]
[code]yum repolist all[/code]

pstein
Posts: 87
Joined: 2008/11/26 21:34:55

Re: How to add a new repository AND its GPG key ?

Post by pstein » 2011/02/16 07:40:42

[quote]
If the repository provides a release RPM package, it normally contains both the repository definition file and the GPG key. Importing the key manually isn't required in that case.
[/quote]

Is it required, that the GPG Key is installed BEFORE the actual Repository?
Or can I do it afterwards as well?

How do I find out if a Repository Release RPM package already contains the GPG key?

How do I list all locally known GPG keys?

Peter

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: How to add a new repository AND its GPG key ?

Post by AlanBartlett » 2011/02/17 06:04:49

[quote]
Is it required, that the GPG Key is installed BEFORE the actual Repository?
[/quote]
No.

[quote]
Or can I do it afterwards as well?
[/quote]
Yes.

[quote]
How do I find out if a Repository Release RPM package already contains the GPG key?
[/quote]
[b]rpm -qpl [i]repository-release[/i].rpm | less[/b]

[quote]
How do I list all locally known GPG keys?
[/quote]
[b]rpm -q gpg-pubkey[/b]

And, then, to answer the question you will probably ask --

[b]for K in $(rpm -q gpg-pubkey); do echo -e "$K\t\c"; rpm -qi $K | grep Sum | cut -c18- ; done[/b]

:-)

Post Reply