Linux YUM configuration highlights

Source: Internet
Author: User

We recommend a very good Linux YUM Configuration System with great learning value. Here I will mainly explain the application of the Linux YUM Configuration System, including the background knowledge of the Linux YUM configuration package.

Linux YUM configuration file

Linux YUM configuration information is stored in a configuration file named yum. conf, which is usually located in the/etc directory. This is the top priority of the entire Linux YUM Configuration System, so it is necessary to introduce it in detail. The following is a yum. con file obtained from the Internet. Let's take this as an example to describe it.

[Main]
Cachedir =/var/cache/yum
Debuglevel = 2
Logfile =/var/log/yum. log
Pkgpolicy = newest
Distroverpkg = redhat-release
Tolerant = 1
Exactarch = 1
Retries = 1

[Base]
Name = Fedora Core $ releasever-$ basearch-Base
Baseurl = http://download.atrpms.net/mirrors/fedoracore/?releasever/?basearch/ OS
Http://rpmfind.net/linux/fedora/cor..er/?basearch/ OS
Http://developer.clarkson.edu/pub/dist..er/?basearch/ OS

[Updates-released]
Name = Fedora Core $ releasever-$ basearch-Released Updates
Baseurl = http://download.atrpms.net/mirrors/fedoracore/updates/?releasever/?basearch
Http://redhat.linux.ee/pub/fedora/l..sever/?basearch
Http://fr2.rpmfind.net/linux/fedora..sever/?basearch

[Fedora. us]
Name = Fedora. us-$ basearch-Extras
Baseurl = Signature

[Dag Wieers]
Name = Dag RPM Repository for Fedora Core
Baseurl = http://apt.sw.be/fedora/?releasever/en/?basearch/dag

[Livna]
Name = Livna RPM, Fedora Core $ releasever-$ basearch
Baseurl = http://rpm.livna.org/fedora/?releasever/?basearch/rpms.stable

[Freshrpms]
Name = FreshRPMs
Baseurl = http://ayo.freshrpms.net/fedora/linux/?releasever/?basearch/freshrpms/
Http://ftp.us2.freshrpms.net/linux/...arch/freshrpms/

Part 1

This is the global configuration of Linux YUM configuration. You do not need to change it by default .)
[Main]
Cachedir: cache directory for Linux YUM configuration. Linux YUM configuration stores the downloaded rpm package and database, usually/var/cache/yum. Debuglevel: debug level, 0-10. The default value is 2 logfile: yum log file. The default value is/var/log/yum. log. Pkgpolicy: the package policy. There are two options: newest and last. If you set multiple repository and the same software exists in different repository, which one should be installed in Linux YUM configuration, if it is newest, yum will install the latest version. If it is last, yum will sort the server IDs in alphabetical order and select the software installation on the last server. Generally, select newest.

Distroverpkg: Specifies a software package. The Linux YUM configuration determines your release version based on this package. The default value is redhat-release, or any installed rpm package for your own release. Exactarch has two options: 1 and 0, indicating whether to upgrade only the same package as the cpu system of your installation package. If it is set to 1, if you have installed an i386 rpm, yum will not be upgraded with a 1686 package. Retries: the number of retries after a network connection error occurs. If it is set to 0, it will retry infinitely. Tolerent also has two options: 1 and 0, indicating whether yum can tolerate errors related to software packages in command lines. For example, you need to install packages 1, 2, and 3, 3 of them have been installed before. If you set it to 1, the Linux YUM configuration will not contain the error message. The default value is 0.

In addition to the above, there are also some options that can be added, such as exclude =, excluding some software in the upgrade list, you can use wildcards, each project in the list should be separated by a space, this is especially useful for those who have installed beautification packages and Chinese patches. Gpgchkeck = there are two options: 1 and 0, which respectively indicate whether or not to perform gpg verification. If this option is not selected, it is also checked by default.

Part 2

Configuring the repository server is the most exciting thing. With a good repository, just like opening a big store at the door, you just need something to run a little errands. By the way, this is a free big store. All server settings should follow the following format:

[Serverid]
Name = Some name for this server
Baseurl = url: // path/to/repository/

Serverid is used to distinguish different repository. It must have a unique name.
Name, which is a description of repository and supports variables such as $ releasever $ basearch;
Baseurl is the most important part in server settings. You can obtain software from it only when the settings are correct. The format is:
Baseurl = url: // server1/path/to/repository/
Url: // server2/path/to/repository/
Url: // server3/path/to/repository/

The url supports three protocols: http: // ftp: // file. After baseurl, it can be followed by multiple URLs. You can change it to an image site with a high speed, but there can only be one baseurl, that is, it cannot be in the following format:
Baseurl = url: // server1/path/to/repository/
Baseurl = url: // server2/path/to/repository/
Baseurl = url: // server3/path/to/repository/
The directory to which the url points must be the upper level of the repository header directory. It also supports variables such as $ releasever $ basearch.
You can add multiple options after the url, such as gpgcheck, exclude, and failovermethod. For example:

[Updates-released]
Name = Fedora Core $ releasever-$ basearch-Released Updates
Baseurl = http://download.atrpms.net/mirrors/fedoracore/updates/?releasever/?basearch
Http://redhat.linux.ee/pub/fedora/linux/core/updates/?releasever/?basearch
Http://fr2.rpmfind.net/linux/fedora/core/updates/?releasever/?basearch
Gpgcheck = 1
Exclude = gaim
Failovermethod = priority

The meaning of gpgcheck and exclude is the same as that of [main], but it only works for this server. failovermethode has two options: roundrobin and priority, meaning that multiple URLs are available, linux YUM configuration selection order, roundrobin is a random selection, if the connection fails, use the next, in turn, and priority starts from the first url order. If not specified, the default value is roundrobin.

Several Variables

$ Releasever: the version of the release, which is obtained from distroverpkg in the [main] section. If not, the redhat-release package is used for determination.
$ Arch, cpu system, such as i686 and athlon
$ Basearch: Basic cpu system group. For example, i686 and athlon belong to the same i386, and alpha and alphaev6 belong to the same alpha.
After setting yum. conf, we can enjoy the convenience of Linux YUM configuration.

By the way, everything is ready. One more thing is not done. That is to import the GPG key of each reposity. As mentioned earlier, the Linux YUM configuration can use gpg to verify the package to ensure the integrity of the downloaded package, so we first go to each repository site to find gpg key, usually on the home page eye-catching position, some names such as RPM-GPG-KEY.txt such as plain text files, download them, and then use the rpm -- import xxx.txt command to import them, it is best to bring the release version of the built-in GPG-KEY also import, rpm -- import/usr/share/doc/redhat-release-*/on the RPM-GPG-KEY official software upgrade.
FC3: rpm -- import/usr/share/doc/fedora-release-3/RPM-GPG-KEY-fedora
FC4: rpm -- import/usr/share/doc/fedora-release-4/RPM-GPG-KEY-fedora
Now all preparations have been completed.

  1. Linux Yum installation configuration and installation command Application
  2. Introduction to the use of Fedora yum management tool in LINUX
  3. Introduction to common software applications installed in yum in Fedora 10
  4. Install and configure yum source in Fedora 10
  5. Detailed introduction to Fedora yum command application installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.