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

To enable a new yum repository, you can add a .repo file for yum under /etc/yum.repos.d/.

For example, to add a repository to install google’s Chrome browser add a file (e.g. chrome.repo) in the /etc/yum.repos.d directory and copy the following to 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. It’s recommended.

Another method, if you know the URL of an RPM file but it is not a part of any repository you can just do:

rpm -ivh http://remote.server.com/path-to-RPM-file

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

Share Button

Leave a comment

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