Do you play games? Management of software packages (ii)--yum

Source: Internet
Author: User

The Yum (Yellow dog Updater, Modified) was developed by the Duke University team, who modified Yellow dog Yellow, a software based on RPM package management, which is a character front-end package manager. The ability to automatically download RPM packages from the specified server and install them, can handle dependencies, and install all dependent packages at once, without the hassle of downloading and installing them over and over again. Used by Yellow Dog Linux itself, as well as Fedora, Red Hat Enterprise Linux. --Wikipedia

Our "yellow" play, the dog is very loyal and reliable, and does help us do a lot of housework and do not make rubbish. Yum is a RPM-based tool, so it manages the RPM package and cannot forget the owner.

Yum uses a C/s structure, which has two parts for the client and server, which the client can understand as the Yum command itself, while the server is our package repository and "metadata". This "meta-data" is similar to our "roster", which records the warehouse information, signatures and what "goods" are in the warehouse. When Huang first come to pick up the goods, it will be cached in their nest a copy of the metadata of the roster, and then in the roster to find the bones they want to find in the future cache to the home a copy, eat after the deletion, the next time to take bone, Ahuang compare their roster and server is consistent, If not, update it and take the bones and leave. This is the basic workflow of Yum, and of course it automatically gives us the ability to solve dependencies on packages.

We know how Huang works. So let's start by building a warehouse, or where it's going to find a bone. If you don't even have a yellow, then you can only use RPM to put one, here will not show. To find the warehouse, we have to have a map first, which is the Yum configuration file:

650) this.width=650; "src=" Http:// "title=" Hc67zir26y]a{trh60%39zv.png "alt=" Wkiol1uqrqdctqqaaakryccxspk222.jpg "/>

Let's explain what it means:

## [main]

## cachedir=/var/cache/yum/$basearch/$releasever

## keepcache=0---whether to keep the package cache

## debuglevel=2---debug level, showing the level of detail at installation

## Logfile=/var/log/yum.log--Log

#exactarch=1---consistent with the current platform

## Obsoletes=1---whether to check packet discards

#gpgcheck=1--check source legitimacy and package integrity

## Plugins=1--and Yum supports plugins

## installonly_limit=5--Installation restrictions

## bugtracker_url= Bug_report_page.php?category=yum

## Distroverpkg=centos-release---release version

Here's a very important/etc/yum.repos.d/the exact map of each of our warehouses under this catalogue

650) this.width=650; "src=" "title=" E] Smplfqeqkkoq1uws{~n[w.png "alt=" Wkiom1uqreqspkgaaacajbglyyi614.jpg "/>

See we have so much, they all have one thing in common is to end with. Repo, which is the standard naming of warehouses. But what to use, don't worry we use Test.repo, because the other repo I have in the internal to write off, and each warehouse has a cost similar to the priority, the default is 1000. Let's take a look at what's on this exact map:

650) this.width=650; "src=" "title=" 2lha~ Yo2g4axve_[[erz0j1.png "alt=" Wkiom1uqrwztdgqtaadiyzwqj4e466.jpg "/>


Each warehouse configuration


# for the current system of Yum, this Repositoryid is used to uniquely identify this repository point, so it must be unique;


# current warehouse description information;


# indicates the access path of the repository, usually a repository that is output on a file server;


FTP Service


HTTP Service


Local directory:



Whether this warehouse can be used


Whether to validate the package


Indicates the path to the Gpgkey file;


Indicates the current repository access cost, which defaults to 1000;

Well, actually here we tease a bit Huang, because we gave it map did not set up a warehouse, Huang is not found. Let's set up the warehouse now. Need to use the Createrepo command, if not installed can only be installed in RPM.

650) this.width=650; "src=" "title=" 31@ Nvb1k0 (]}5pykjv1gw8h.png "alt=" Wkiol1uqseib1hzlaae7kugyz4y984.jpg "/>

Here I hang up the CentOS CD, let's take him as a warehouse, and see why it can become a warehouse?

650) this.width=650; "src=" Http:// "title=" J7I32D9 (s9~s2$]f091oc]p.png "alt=" Wkiol1uqslbhebyqaacxz3oafaq266.jpg "/>

Did you find a directory called Repodata and see what's inside?

650) this.width=650; "src=" Http:// "title=" 075ntj51 ' 9f]k~s) v~1v) 7k.png "alt=" Wkiom1uqr6rw0urdaaihvisgtji374.jpg "/>

OK, this is our metadata, with it on behalf of our warehouse has been the right to use, if you remember our map path pointing to the Repodata directory should be the parent directory, that a bunch of messy numbers is actually the warehouse signature, identifies whether the warehouse has changed.

650) this.width=650; "src=" "title=" {6b{[~ 1X}R_) 4ilpayhdo4d.png "alt=" Wkiom1uqscrrolgdaacj1j4mlpg448.jpg "/>

650) this.width=650; "src=" "title=" zihlpq ) ~pu) yfmxkch5}csc.png "alt=" Wkiom1uqsflskopgaaqefp_nney340.jpg "/>

Is there a directory called Repodata Ah, as to why in this directory is built, because I configured the HTTPD service on the host, of course, we can also configure an FTP service.

650) this.width=650; "src=" "title=" nhzq_ Pk4f{6c~l%tdxwh[ht.png "alt=" Wkiom1uqspnhwg1jaadwolpjess589.jpg "/>

Of course, this FTP I did not configure to repo warehouse, but I shared some of the script I wrote. All right, all is owed to the East Wind:

# #yum: The system cannot have two Yum processes start at the same time

## command is one of:

## * Install Package1 [Package2] [...]--y auto Answer Yes

## * Update [PACKAGE1] [Package2] [...]-upgrade

## * update-to [Package1] [Package2] [...]

## * check-update---check for available upgrades and need to configure upgrade paths

## * upgrade [PACKAGE1] [Package2] [...]

## * upgrade-to [Package1] [Package2] [...]

## * distribution-synchronization [Package1] [Package2] [...]

## * Remove | Erase Package1 [Package2] [...]-Uninstalling a dependent package unloads the package that depends on it

## * list [...]

## yum list extras [GLOB_EXP1] [...]-the machine is loaded, but the Yum warehouse is not

## yum list obsoletes [GLOB_EXP1] [...]-the machine is loaded, but there are newer versions

## Yum List Recent---new packages added in the Yum repository

## * Info [...]-Query package information

## * provides | Whatprovides Feature1 [Feature2] [...]-Query the specified file by which package installation is complete

## * Clean [packages | metadata | expire-cache | rpmdb | plugins | all]--cleanup Package | metadata | Expiration Cache |rpm Database | plugins | all

## * Makecache---Create cache

## * Groupinstall group1 [group2] [...]

## * groupupdate group1 [group2] [...]

## * grouplist [hidden] [Groupwildcard] [...]-List of groups, can install | Uninstall a group

## * Groupremove group1 [group2] [...]-

## * GroupInfo group1 [...]-Display the details of the Charter, install and use the package group to use "" Cause, CentOS7 use install, such as: Yum install @ "Server Platform Development "

## * Search string1 [string2] [...]-searches for the specified keyword in the package name and sumary information

## * shell [filename]

## * RESOLVEDEP dep1 [DEP2] [...]

## * Localinstall rpmfile1 [rpmfile2] [...]-Install the local package file instead of the warehouse, and use the install after CentOS7

# # (maintained for legacy reasons Only-use install)

## * Localupdate rpmfile1 [rpmfile2] [...]-Upgrade the local package file instead of the warehouse

# # (maintained for legacy reasons Only-use Update)

## * Reinstall Package1 [Package2] [...]-Overwrite installation

## * Downgrade Package1 [Package2] [...]--downgrade

## * Deplist package1 [Package2] [...]

## * repolist [all|enabled|disabled]-Show all | available | disable warehouse information

## * Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo]

## * History [info|list|packages-list|packages-info|summary|addon-info|redo|undo|roll-back|new|sync| Stats

## * load-transaction [Txfile]

## * Check

## * Help [command]

Good, don't panic not busy, let me give you a demonstration will be very clear:

650) this.width=650; "src=" "title=" Nw4}ms {}u)) [VT ' Dh8@{9c2.png "alt=" Wkiom1uqtjez3o62aaj5jmq7j6o316.jpg "/>

Here clean all is empty so cache, Repolist is to view the warehouse list, because 172 network segment is in the classroom IP segment so not even, but I once the native HTTP server IP to changed, so Xen4 is available.

650) this.width=650; "src=" "title=" p8%i DFD6SGYZJ8N9C5CV) [e.png "alt=" Wkiol1uqt1cxuyfjaankfpa6rqo664.jpg "/>

650) this.width=650; "src=" "title=" [218t@ ~%br ' 0gg9q}8_sk0m.png "alt=" Wkiol1uqtzzbwxweaajez0qn4w4906.jpg "/>

Install is installed, and-Y is automatically answered yes, we see the installation of Xen using the DVD1 and xen4 these two warehouses.

650) this.width=650; "src=" Http:// "title=" Ns5h5isogi ' 2e06_765nl~j.png "alt=" Wkiol1uquj_xatwvaagxtyfhnty288.jpg "/>

Info to view information about the package

650) this.width=650; "src=" "title=" m}$ Ek36vcx9hs91v7vs~ybd.png "alt=" Wkiol1uquspd3fudaacp0qanbn4273.jpg "/>

Update is an upgrade package, there is no need to upgrade

650) this.width=650; "src=" "title=" 47vd3$ O6e1rwj$~wnmodnlt.png "alt=" Wkiom1uquencrxgqaae397nkbvu745.jpg "/>

We sometimes encounter the need to install a package group, you can use Grouplist to view the later use of the Groupinstall installation is ready, no longer demonstrated.

650) this.width=650; "src=" "title=") p6a~z ) H50h3 (g{jr% (FR) 8.png "alt=" Wkiol1uqu8srqhsxaakxwljax9g616.jpg "/>

Remove Uninstall Package

Well, that's roughly how Yum is used, and the other options are to use man or continue to learn in practice. Here's a little bit of knowledge to add:

Yum has built-in variables to hold information about the current platform, and the client downloads the profile to automatically select the appropriate RPM package for its arch.

(1) $raleasever: The major version number of the current OS release;

For example, for CentOS 6.6 x86_64, the major version number is 6;

(2) $arch: Platform

i386, i486

(3) $basearch: Basic platforms, such as i686, i586, i486 and i386, are i386;

(4) $YUM 0-$YUM 9--Custom variables used

# #如果6升级为6.1, we can have ln 6--and 6.1 so that the client can upgrade to 6.1 of the installation package warehouse without changing it for example:


The current system is CentOS 6.6 x86_64

I hope this article can bring you help, if there are errors please correct me, humbly!

This article is from the "Linuxlove" blog, make sure to keep this source

Do you play games? Management of software packages (ii)--yum

Related Article

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: 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.