repository
] sections (where repository
is a unique repository ID, such as [my_personal_repo
]) to /etc/yum.conf
or to .repo
files in the /etc/yum.repos.d/
directory. All .repo
files in /etc/yum.repos.d/
are read by yum
; best practice is to define your repositories here instead of in /etc/yum.conf
. You can create new, custom .repo
files in this directory, add [repository
] sections to those files, and the next time you run a yum
command, it will take all newly-added repositories into account.
.repo
file should take:
[repository_ID] name=A Repository Name baseurl=http://path/to/repo or ftp://path/to/repo or file://path/to/local/repo
repository
] section must contain the following minimum parts:
repository_ID
] <My Repository Name>
baseurl=http://path/to/repo/releases/$releasever/server/$basearch/os/
$releasever
, $arch
and $basearch
variables in URLs. See the following section for explanations of all Yum variables: Section 1.3.3, “Using Yum Variables”.
http://path/to/repo
by prepending it as username:password@link
. For example, if a repository on http://www.example.com/repo/ requires a username of "user" and a password of "password", then the baseurl
link could be specified as:
baseurl=http://user
:password
@www.example.com/repo/
repository
] directive:
<value>
<value>
is one of:
0
— do not include this repository as a package source when performing updates and installs. This is an easy way of quickly turning repositories on and off, which is useful when you desire a single package from a repository that you do not want to enable for updates or installs.
1
— include this repository as a package source.
--enablerepo=<repo_name
>
or --disablerepo=<repo_name
>
option to yum
, or easily through PackageKit's Add/Remove Software window.
repository
] options exist. Refer to the [repository] OPTIONS
section of man yum.conf
for the exhaustive list and descriptions for each.