Linux Magic Yum

Source: Internet
Author: User
Tags ftp site

What exactly is Yum? What is the function and role of Yum? Why do we have the Software Installation tool for Yum after we have RPM? I wonder if you've ever thought about it for just a few seconds.

One: Yum Introduction:

Yum, the abbreviation for Yellow Dog updater,modified, was originally developed by Yello, a developer of the distribution of soft, in Python, then called yup (Yellow dog Updater), This was followed by an improvement by the [email protected] development team at Duke University.

Yum's mission is to automate upgrades, install/remove RPM packages, collect information about RPM packages, check dependencies and automatically prompt users to resolve them. The key to Yum is that it has a reliable repository, as the name implies, this is the repository of the software, it can be an HTTP or FTP site, or it can be a local software pool, but must include RPM Header,header includes various information of RPM package, including description, function, The files, dependencies, etc. are collected and analyzed in order to automate the completion of the remaining tasks.

Two: Yum configuration file

All of the configuration information for Yum exists in a configuration file called yum.conf, usually located in the/etc directory, which is a priority for the entire Yum system. Let me cat a little bit of this file.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/86/54/wKioL1e8A7_DtlgOAABVRL9ami0066.png-wh_500x0-wm_3 -wmp_4-s_2233160913.png "title=" 12.png "alt=" Wkiol1e8a7_dtlgoaabvrl9ami0066.png-wh_50 "/>

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/54/wKioL1e8A96zw4__AAALuGFCg7g393.png-wh_500x0-wm_3 -wmp_4-s_3627622307.png "title=" 13.png "alt=" Wkiol1e8a96zw4__aaalugfcg7g393.png-wh_50 "/>

The first part (this is the global setting for Yum, which is usually not changed by default)

[Main]

Cachedir:yum cache directory, yum stores downloaded RPM packages and databases, typically/var/cache/yum

DebugLevel: Debug level, 0-10, default is 2

Logfile:yum log file, default is/var/log/yum.log

Pkgpolicy: The policy for the package. There are two options, newest and last This function is if you set up multiple repository, and the same software in different repository exist simultaneously, Yum should install which, if it is newest, yum will install the latest version. If it is last, Yum will sort the server ID alphabetically and select the software installation on the final server. Newest is generally chosen.

DISTROVERPKG: Specify a package, Yum will determine your distribution based on this package, default is Redhat-release, it can also be installed in any of the RPM package for its own release version.

Exactarch: The number of retries after a network connection error has occurred, and if set to 0, it will be retried indefinitely.

The retries:1 and 0 options indicate whether Yum tolerates a package-related error on the command line, such as installing a three-in-one package, but 3 has already been installed, and if you set it to 1, Yum will not have an error message. The default is 0.

In addition to the above, there are some options that you can add, such as:

Exclude=, excluding some software in the upgrade list, you can use wildcards, the list of items to be separated by a space, which is installed such as beautify the package, Chinese patches of friends especially useful.

Gpgcheck=, there are 1 and 0 choices, respectively, whether to do GPG verification, if there is no calibration, the default is checked, that is, 1.

Part II:

Configure the repository server, which is the most exciting, with good repository, like a free supermarket in front of the house, want to run errands on the line.

[ServerID]

Name=some name for this server

baseurl=url://path/to/repository/

Where ServerID is used to differentiate between different repository, there must be a unique name. and must be in []

Name, which is a description of repository, supports variables such as the $releasever $basearch;

BaseURL is the most important part of the server Setup and is only set correctly to get the software from above. Its format is:

baseurl=url://server1/path/to/repositroy/

baseurl=ur2://server1/path/to/repositroy/

baseurl=ur3://server1/path/to/repositroy/

Where the URL supports the protocol has http:/ftp://file://three kinds. Bashurl can be followed by multiple URLs, where the URL points to a directory that must be the upper level of the Repository header directory.

You can add multiple options after the URL, such as Gpgcheck,exclude,failovermethod, etc.

Such as

[Updates-released]

Name=fedora Core $releasever-$basharch-released Updates

baseurl=http://downloadatrpms.net/mirrors/fedoracore/updates/$releasever/$bashurl

http://redhat.linux.ee/pub/fedora/linux/core/updates/$releasever/$bashurl

http://fr2.rpmfind.net/linux/fedora/core/updates/$releasever/$basharch

Gpgcheck=1

Exclude=gaim

Failovermethod=priority

Where the meaning of gpgcheck,exclude is the same as the [main] part, but only works on this server,

Failovermethode There are two options roundrobin and priority, which means that when multiple URLs are selectable, Yum selects the order, Roundrobin is randomly selected, if the connection fails, the next one is used, loops in turn, Priority is based on the order of the URLs, starting with the first one. If not specified, the default is Roundrobin.

Several variables

$releasever, the release version, obtained from the [main] section of distroverpkg, if not, according to the Redhat-release package.

$basearch, the basic system groups of CPUs, such as i686 and Athlon, belong to the same genus I386,alpha and Alphaev6 Alpha.

With the yum.conf set up, we can enjoy the convenience of Yum and see you next. My wish is that the world is no longer the drone of a prostitute.















This article is from the "11897401" blog, please be sure to keep this source http://11907401.blog.51cto.com/11897401/1841598

Linux Magic Yum

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.