The working mechanism and configuration of Yum

Source: Internet
Author: User

Yum solves dependencies that RPM cannot resolve, but Yum relies on RPM to run

    • Yum Server

      All RPM packages to be released are placed on the Yum server to provide others to download, and RPM packages are compiled and published separately based on the version number of the kernel and the version number of the CPU. The Yum server is available as a simple download, either FTP or httpd. One of the most important aspects of the Yum server is to sort out the basic information for each RPM package, including the version number of the RPM package, the Conf file, binary information, and critical dependency information. The Createrepo tool is available on the Yum server to make the Basic profile (metadata) of the RPM package a "checklist" that describes the information in the spec file for each RPM package.

    • Yum Client Side

      Each time the client calls Yum install or search, it will parse all of the following configuration files ending with. Repo, which specify the address of the Yum server./etc/yum.repos.d. Yum periodically "updates" the RPM package "list" on the Yum server and saves the "inventory" download to Yum's own cache, which is configured according to/etc/yum.conf (by default, under/var/cache/yum). Each time the Yum package is called, it will go to the cache directory to find the "list", according to the "list" in the RPM package to determine the name of the installation package, version number, the required dependencies, etc., and then go to the Yum server download RPM package installation. (Provided that there is no cache for the RPM package), Yum automatically deletes the installed program's installation package after the installation is complete, but does not delete the metadata for the next use


Yum warehouse equivalent to RPM warehouse + meta data

Createrepo command (used to parse each package to generate metadata in the RPM warehouse)

When using the Yum management software for the first time, Yum will automatically download the required headers placed in the/var/cache/yum directory;

Yum Warehouse---->Yum cache----> Local Installation


Yum configuration file:

1.   /etc/yum.conf: Provide public configuration for all warehouses
[m Ain]
cachedir :   yum directory of cache, yum stores downloaded RPM packages and databases under this path, typically/var/cache/yum.
debuglevel debug Level, 0──10, default is 2
Span style= "color: #0000F0;" >logfile :    yum log file, default is/var/log/yum.log.
pkgpolicy : policy for the package.

A total of two options, newest and last, this role is if you set up multiple repository, While the same software exists in different repository, Yum should install whichever, and 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, by default it is redhat-release, or it can be any RPM package installed for its own release version.
exactarch : There are two options 1 and 0, Represents whether to upgrade only packages that are consistent with your installation of the package CPU, and if set to 1, if you install a i386 rpm, Yum does not upgrade with i686 packages.
retries:    retry attempts after a network connection error, and if set to 0, it will be retried indefinitely.
tolerent:   also has 1 and 2 options to indicate whether Yum tolerates a package-related error on the command line, such as installing a three-by-five package, and 3 of them have 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 options that you can add, such as
exclude:    exclude certain software from the upgrade list, you can use a wildcard character, Each item in the list is separated by a space, which is especially useful for a friend who installs a Chinese patch such as a beautification package.
gpgcheck: there are 1 and 2 choices, each of which represents whether or not the GPG check is performed, and if not, the default appears to be checked.

Plugins: Whether to enable all plugins (plug-in), the default is 0, which means not enabled. Since Rhel provides Yum with a plug-in called Rhn-plugin to read the Yum download source provided by the portal, you must maintain this parameter of 1 in order to successfully install and upgrade your RHEL using the portal's Yum download source.

Metadata_expire: defines the expiration time, in seconds, of data in the Yum cache.

Proxy: Specifies the path (URL) of the proxy server to use when reading the download source.

2.   /etc/yum.repos.d/*.repo: Provides configuration for the point of the warehouse

        Warehouse Point definition:
        [repositoryid]
         name=some name for this repository
        baseurl= url://path/to/repository/
        enabled={1|0}
         gpgcheck={1|0}
        gpgkey=url
        enablegroups={1|0}
        failovermethod={roundrobin|priority}
              The default is: Roundrobin, which means random selection; when there are multiple BaseURL, polling is selected, if you choose              roundrobin, random selection        

cost= (default = 1000)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A6/wKioL1XqsMCiTFLBAABvPi29niw042.jpg "title=" 183. PNG "alt=" wkiol1xqsmcitflbaabvpi29niw042.jpg "/>

Use of the Yum tool:

Yum command-Line options:
--nogpgcheck: No GPG check is allowed;
-Y: Auto Answer "yes";
-Q: Silent mode;
--disablerepo=repoidglob: Temporarily disables the repo specified here;
--enablerepo=repoidglob: Temporarily enable the repo specified here;
--noplugins: Disable all plugins;

The variables available in the Yum repo configuration file:
$releasever: The major version number of the current OS release version;
$arch: platform;
$basearch: Basic platform;
$YUM 0-$YUM 9

Variables are used in the following configuration:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/AB/wKiom1XqyvLx0vOvAAHkI4mYydQ790.jpg "title=" 188. PNG "alt=" wkiom1xqyvlx0vovaahki4myydq790.jpg "/>

Man manual output
Yum [options] [command] [package ...]
command is one of:
* Install Package1 [Package2] [...]
* Update [PACKAGE1] [Package2] [...]
* Update-to [Package1] [Package2] [...]
* Check-update
* upgrade [Package1] [Package2] [...]
* Upgrade-to [Package1] [Package2] [...]
* Distribution-synchronization [Package1] [Package2] [...]
* Remove | Erase Package1 [Package2] [...]
* List [...]
* Info [...]
* provides | Whatprovides Feature1 [Feature2] [...]
* Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
* Makecache
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]
* Search string1 [string2] [...]
* Shell [filename]
* RESOLVEDEP DEP1 [DEP2] [...]
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
* Reinstall Package1 [Package2] [...]
* Downgrade Package1 [Package2] [...]
* Deplist Package1 [Package2] [...]
* Repolist [all|enabled|disabled]
* Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo]
* History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
* Check
* Help [command]


Summary usage:

Show Warehouse list:
Repolist [all|enabled|disabled]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/A6/wKioL1Xqs8WBUcs0AAEWBT8Te-k543.jpg "title=" 184. PNG "alt=" wkiol1xqs8wbucs0aaewbt8te-k543.jpg "/>

Show Packages:
List
# yum list [all | glob_exp1] [GLOB_EXP2] [...]
# Yum list {available|installed|updates} [GLOB_EXP1] [...]

To install the package:
Install Package1 [Package2] [...]
Reinstall Package1 [Package2] [...] (reinstall)
Upgrade Package:
Update [PACKAGE1] [Package2] [...]
Downgrade Package1 [Package2] [...] Downgrade
Check for available upgrades:
Check-update
To uninstall a package:
Remove | Erase Package1 [Package2] [...]
To view the package information:
info [...]
View which package is provided by the specified attribute (which can be a file):
provides | Whatprovides Feature1 [Feature2] [...]
To clean up the local cache:
Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
Build cache:
Makecache

Search:
Search string1 [string2] [...]
Search for the package name and summary information with the specified keywords;
View the capabilities that the specified package depends on:
Deplist Package1 [Package2] [...]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/A6/wKioL1XqtomRGjcbAAESPEd_gjg340.jpg "title=" 185. PNG "alt=" wkiol1xqtomrgjcbaaesped_gjg340.jpg "/>

View Yum Transaction history:
History [Info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/AA/wKiom1XqtRKQDMxDAAC_DfVBNmU525.jpg "title=" 186. PNG "alt=" wkiom1xqtrkqdmxdaac_dfvbnmu525.jpg "/>

To install and upgrade the local package:
* Localinstall Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use install)
* Localupdate Rpmfile1 [rpmfile2] [...]
(Maintained for legacy reasons Only-use Update)
Related commands for package group management:
* Groupinstall group1 [group2] [...]
* Groupupdate group1 [group2] [...]
* grouplist [hidden] [Groupwildcard] [...]
* Groupremove group1 [group2] [...]
* GroupInfo group1 [...]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/A7/wKioL1Xqubmyz8JdAAFGyeGiSW8254.jpg "title=" 187. PNG "alt=" wkiol1xqubmyz8jdaafgyegisw8254.jpg "/>


This article is from the "After Tomorrow" blog, please be sure to keep this source http://leeyan.blog.51cto.com/8379003/1691586

The working mechanism and configuration of 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.