Marco Linux Learning Yum Configuration

Source: Internet
Author: User
Tags gpg ftp protocol yum repolist

Learning to the 11th day, the system-related software configuration using RPM package or source configuration will encounter a variety of dependency problems, Yum is Red Hat out of the package management tools, can effectively automatically solve the dependencies of the package.


YUM (Yellowdog Update Modifier): A tool that integrates all kinds of program dependencies and automatically resolves them when installing software. This tool uses the C/s architecture, which is divided into server-side (yum repositories) and clients.

Yum Warehouse related.

The Yum repository consists primarily of data and meta data. data is a variety of software packages, and metadata is the package name, version information, each package contains a list of files, dependencies, packet grouping information, and so on.

The Yum warehouse can be divided into several types:

Base library: A software library that is basic to the system release

Update Library: Updating the Software Library

Extra Library: Additional package libraries

Epel Library: Extra Packages for Enterprise, the community's best-built free open source release package Repository, the system contains about 10,000 + packages.


The Yum repository provides location information for packages, and in Linux systems, this is a common way to mount discs on HTTP servers, FTP servers, and local file system directories three.

Let's experiment with creating an HTTP type and a local yum repository.

First, the HTTP type, divided into the following steps:

1, first install the Createrepo ha, or can not make the Yum warehouse.

2. We then install Apache on the machine that supplies the warehouse and turn it on, using the default configuration to/var/www/html to access the directory. Then I created a RPMs directory under this directory and placed 164 packages under RPMs (less, but just to learn ha).

3, in the/var/www/html directory, using the Createrepo command, wait a while, Yum warehouse metadata will be generated. Well, this metadata, which is organized under CentOS 5 using XML, is used in the CentOS 6 version of Splite.

4, Next, we will configure the client's yum configuration file ha, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/A4/wKioL1UzvLLzeHlqAAEthN9rWoI199.jpg "style=" float: none; "title=" Movetheorgrepo.png "alt=" Wkiol1uzvllzehlqaaethn9rwoi199.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6B/A9/wKiom1Uzu1qS9ckHAABtWBKE_yE107.jpg "style=" float: none; "title=" Yum_repo_config_http.png "alt=" Wkiom1uzu1qs9ckhaabtwbke_ye107.jpg "/>

Well, the first figure is to remove the Yum source installed by the CentOS default first.

The second figure is the configuration file for this HTTP type of Yum source. Here are the functions and configurations of the corresponding fields:

      • Repositoryid (middle bracket): Used to specify a warehouse

      • Name: Used to specify the easy-to-read warehouse name

      • BaseURL: The URL used to specify the repository, which can be of several types:

        • http-used to specify the source of the remote HTTP protocol

        • ftp-used to specify the source of the remote FTP protocol

        • file-for local mirroring or NFS mount file systems

        • Mirrorlist: Mirror site for the specified warehouse

      • Enabled: Used to specify whether to use this warehouse, the default value is 1, which is available

      • Gpgcheck: Used to specify whether to check the GPG signature of the software package

      • Gpgkey: Used to specify the URL of gpg signature file, remember the same URL ha.


Configured, use the Yum repolist command to see which Yum source you can use.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6B/A4/wKioL1Uzvy7S6rRvAAC-rDV0q8E195.jpg "title=" Httprepo.png "alt=" wkiol1uzvy7s6rrvaac-rdv0q8e195.jpg "/> seems to be successful, ha, and then then again after the deployment of the local Yum source, Because the local Yum source is usually mounted on a CD or ISO image (equivalent to a CD-ROM) ha, so it is directly targeted.

In general, the CD or ISO image, is generated by the corresponding metadata, there is less createrepo this step ha. Configure the local source of Yum directly.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6B/A5/wKioL1UzwBzRAURVAAHOrkY3Jhs088.jpg "title=" Localrepo-config.png "alt=" wkiol1uzwbzraurvaahorky3jhs088.jpg "/> Everyone saw, and the HTTP type is different from BaseURL there. Directly in the Repodate directory, whichever is the directory. My ISO is attached to the/MNT directory, not too standard ha, we do not learn. Then look at the Yum repolist:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6B/A5/wKioL1UzwI_wMicdAAD8AkkGh8I802.jpg "title=" Localtestrepo.png "alt=" wkiol1uzwi_wmicdaad8akkgh8i802.jpg "/> Haha, more identified as the source of centos6-localtest, there are 6,367 of packages.


common use commands for the Yum tool.


1. List all available repo

Yum repolist {Enabled|disabled|all}

2. List all the packages that can be installed:

Yum List {all | installed | available}

Yum List keyword*

3. Package Description Information

Yum Info package_name

4. List all Package group information

Yum Grouplist

5, display the package group information:

Yum groupinfo "GROUP NAME"

The following four are commonly used package groups ha:

CentOS6 with development-related package groups:

Development Tools

Server Platform Development

Desktop Platform Development

6. Clean up the cache

Yum Clean {all|packages|metadata|expire-cache|rpmdb|plugins}

7. Install Package

Yum Install Package_name

Reinstall: Yum Reinstall package_name

8. Upgrade Package

The Yum check-update command checks to see if an upgrade package is available

Yum Update package_name

9. Uninstall

Yum Remove|erase package_name

10. Query which package the file is generated by

Yum Whatprovides|provides/path/to/somefile

11. installation package Group

Yum Groupinstall "GROUP NAME"

12. Unload Package Group

Yum groupremove "GROUP NAME"

The language is not good, I will improve, Goodnight ╰ (*′︶ ' *) ╯

Marco Linux Learning Yum Configuration

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.