Yum Repository Configuration For RedHat, CentOS, and Fedora – POFTUT

Yum Repository Configuration For RedHat, CentOS, and Fedora

yum is a tool used to manage rpm packages in distributions like RedHat, CentOS, Fedora, etc. Most know feature of yum is using repositories in order to manage packages download and resolve dependencies. In this tutorial, we will examine the yum repository configuration.

List Yum Repository Configurations

yum repositories are stored as files with related configuration. These configuration files are stored in /etc/yum.repos.d/ . We can list currently created repositories with ls command like below.

$ ls /etc/yum.repos.d/
List Yum Repository Configurations
List Yum Repository Configurations

Repository Configuration Files

Each of these configuration files holds some configuration a single or multiple branches. A single repository may have multiple different branches for different purposes. We can list configuration with cat command like below. We will print the repository fedora.repo .

$ cat /etc/yum.repos.d/fedora.repo
Look In Detail Repository Configuration
Look In Detail Repository Configuration

There are different confugration options.

  • name is the name of the repo
  • failovermethod used what will be done if there is a problem
  • baseurl is the URL to download repository database and information
  • metalink is the URL the metadata of the repository
  • enabled specified whether this repository is enabled and usable. We can disable if we do not want to use further.
  • metadata_expire specifies how long the downloaded metadata is fresh and useable
  • pgpcheck is a security mechanism which checks package is altered or created by the repository owner.
  • gpgkey is the GPG key file path

Add New Yum Repository

There are different ways to add a yum repository. We can use yum command to add repository too. We will use localinstall command and provide the rpm URL with --nogpgcheck option like below.

$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rp
Add New Yum Repository 
Add New Yum Repository 

Top External Third Party Repositories

Here we will list 3rd party yum repositories which is very useful.

LEARN MORE  Linux RPM Command With Examples For CentOS, RedHat, Fedora

Leave a Comment