此内容没有您所选择的语言版本。
14.4.2. [repository] Options
The
[repository]
section of the /etc/yum.conf
file contains information about a repository yum
can use to find packages during package installation, updating and dependency resolution. A repository entry takes the following form:
[repository ID] name=repository name baseurl=url, file or ftp://path to repository
You can also specify repository information in a separate
.repo
files (for example, rhel5.repo
). The format of repository information placed in .repo
files is identical with the [repository]
of /etc/yum.conf
.
.repo
files are typically placed in /etc/yum.repos.d
, unless you specify a different repository path in the [main]
section of /etc/yum.conf
with reposdir=
. .repo
files and the /etc/yum.conf
file can contain multiple repository entries.
Each repository entry consists of the following mandatory parts:
- [repository ID]
- The repository ID is a unique, one-word string that serves as a repository identifier.
-
name=repository name
- This is a human-readable string describing the repository.
-
baseurl=http, file or ftp://path
- This is a URL to the directory where the
repodata
directory of a repository is located. If the repository is local to the machine, usebaseurl=file://path to local repository
. If the repository is located online using HTTP, usebaseurl=http://link
. If the repository is online and uses FTP, usebaseurl=ftp://link
.If a specific online repository requires basic HTTP authentication, you can specify your username and password in thebaseurl
line 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 os "password", then thebaseurl
link can be specified asbaseurl=http://user:password@www.example.com/repo/
.
The following is a list of options most commonly used in repository entries. For a complete list of repository entries, refer to
man yum.conf
.
-
gpgcheck=<1 or 0>
- This disables/enables GPG signature checking a specific repository. The default is
gpgcheck=0
, which disables GPG checking. -
gpgkey=URL
- This option allows you to point to a URL of the ASCII-armoured GPG key file for a repository. This option is normally used if
yum
needs a public key to verify a package and the required key was not imported into the RPM database.If this option is set,yum
will automatically import the key from the specified URL. You will be prompted before the key is installed unless you setassumeyes=1
(in the[main]
section of/etc/yum.conf
) or-y
(in ayum
transaction). -
exclude=<package name/s>
- This option is similar to the
exclude
option in the[main]
section of/etc/yum.conf
. However, it only applies to the repository in which it is specified. -
includepkgs=<package name/s>
- This option is the opposite of
exclude
. When this option is set on a repository,yum
will only be able to see the specified packages in that repository. By default, all packages in a repository are visible toyum
.