How do I add a new RPM/yum repo in Fedora

To enable a new RPM (yum) repository add a new .repo file for it under /etc/yum.repos.d. For example, to add a repository to install google’s Chrome browser add a file (e.g. google.repo) in the /etc/yum.repos.d directory and copy the following into it:

[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

You may also append the new repositories info to the /etc/yum.conf file but the above is a cleaner method.

Often a repository will provide a platform-independent package which installs it on the system, e.g. rpmfusion.org works this way. The link explains how to do this.

And yet a third method, if you know the location of an RPM file on the net but it is not a part of any repository you can just do:
rpm -Uhv http://remote.server.com/path-to-RPM-file

Replace the http above by ftp if the file is provided via ftp…

2 thoughts on “How do I add a new RPM/yum repo in Fedora

  1. … expanding a little bit on the /etc/yum.repos.d fil above:
    If you know just the directory containing the RPM files (the baseurl) and do not know where the gpgkey is you can still use the repo. Just add all the above info except the gpgkey and then when invoking yum specify the --nogpgcheck switch. Of course you need to have a high degree of confidence in this repository to accept unsigned files from it…

    For example, I added the chromium browser Fedora repository (described here: http://code.google.com/p/chromium/wiki/LinuxChromiumPackages) in such a manner becasue I could not figure out where the gpg key is. There is probably a way to use the data in the …/repodata sub-directory somehow, perhaps using the createrepo command but I don’t know how to do it…

Leave a Reply to ench0 Cancel reply

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