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
How to add a new repository AND its GPG key ?
-
- Posts: 22
- Joined: 2009/06/29 19:23:16
Re: How to add a new repository AND its GPG key ?
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
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
Re: How to add a new repository AND its GPG key ?
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
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
How to add a new repository AND its GPG key ?
[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 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]
Re: How to add a new repository AND its GPG key ?
[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
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
- 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 ?
[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]
:-)
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]
:-)