Linux Package Management Yum

Source: Internet
Author: User
Tags gpg yum repolist

Update, Yellowdog update Modifier, YUM


What is Yum?

Yum is a shell front-end package manager in Fedora and Redhat as well as in SuSE. Based on RPM package management, the ability to automatically download RPM packages from specified servers and install them automatically handles dependency relationships and installs all dependent packages at once, without the hassle of downloading and installing them over and over again. Yum is based on the Yum database, which supports 4 file services, using FTP, Web, NFS, and local file files. Yum is actually the repository for the RPM package, which has a cache that caches the metadata files in the Yum repository.

Why use the Yum Package Manager?

RPM Package installation has a big drawback is that the file is too large , sometimes installed a software to install a lot of other packages, very troublesome, so Redhat developed the Yum installation method, can completely solve the problem of relevance.



Yum Repository:yum Warehouse

A file (placed in the Repodata directory) server that stores many RPM packages and the relevant metadata for the package


File Services:

HTTP ./"These two//denotes escape character"

ftp:// "This two//denotes escape character"

nfs:// "This two//denotes escape character"

file:/// "The root of the next/local path"


Yum Client:

Configuration files: points to the location of the warehouse and various configuration information, each Yum customer can have more than one available Yum warehouse;


Master configuration file:/etc/yum.conf

/etc/yum.repos.d/*.repo


Warehouse Definition:

[REPO_ID] Warehouse ID, identifier

Name=repo Description Descriptor

baseurl=ftp://172.16.0.1/pub/centos6/ Warehouse Specific location path

Enabled={1|0} Indicates whether the current warehouse is being used and is enabled by default of 1

Gpgcheck={1|0} whether to verify the integrity of the data in GPG format, if 1 o'clock, you must specify the specific path of the Gpgkey=file

Gpgkey=ftp://172.16.0.1/pub/centos6/gpg-key indicates a specific path to GPG, which may be on FTP, on the web, or on a local path, to specify a clear

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/53/FE/wKiom1R1da7gfuFVAAE1AzTnUl8920.jpg "title=" image 1. PNG "alt=" wkiom1r1da7gfufvaae1aztnul8920.jpg "/>

Yum Command: yum [options] [command] [package ...]


Yum Warehouse-related commands:

list all available warehouses: # yum Repolist

List all packages: # Yum list {all|installed|available}

Supports globbing wildcard characters: *

List all package groups: # yum Grouplist

Cache Management: # yum Clean {all|packages}

# yum Makecache


Installation: yum install package_name ...

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/53/FC/wKioL1R1drXgrdrLAAJDGA8Kr50323.jpg "title=" Image 2. PNG "alt=" wkiol1r1drxgrdrlaajdga8kr50323.jpg "/>


If you want to install the specified version of the program: Yum Install package-version


Reload The specified package: yum Reinstall Package_name ...


Upgrade: Yum Update package_name


If more than one version of the upgrade package is available and is only expected to be upgraded to the specified version:

Yum Update package-version


Downgrade:Yum downgrade package_name


check for available upgrades: Yum check-update

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/53/FC/wKioL1R1dyqw_K1CAAMgO-zk190187.jpg "title=" Image 3. PNG "alt=" wkiol1r1dyqw_k1caamgo-zk190187.jpg "/>

Uninstall: Yum erase|remove package_name

Other packages that depend on the specified package will be uninstalled;


Enquiry: Yum List

Yum Info package_name

Yum Search KEYWORD: The sumary information for the package name or package based on the keyword fuzzy query contains the relevant KEYWORD list;

Yum Provides|whatprovides/path/to/somefile


Package Group Management:

Show all package groups:Yum grouplist

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/53/FC/wKioL1R1d37QhhMyAAHa3rgPHnE593.jpg "title=" Image 4. PNG "alt=" wkiol1r1d37qhhmyaaha3rgphne593.jpg "/>

to display information about a package group: yum groupinfo "Group_name"

Install package Group: yum groupinstall "Group_name"

Yum Install @GROUP_NAME

To unload a package group:

Yum groupremove "Group_name"

Yum Remove @ "group_name"

Upgrade Package Group:

Yum groupupdate "Group_name"


The Yum command can also be used to install local RPM package files:

Yum localinstall/path/to/rpm_package_file ...


CentOS 7:yum Install/path/to/rpm_package_file ...


Options:

--enablerepo= followed by repoid indicates that a yum warehouse is enabled

--disablerepo= followed by repoid means to disable a yum warehouse

Note: Precedence is higher than the attribute defined in the/etc/yum.repos.d/*.repo configuration file;

-y: Auto Answer yes

--nogpgcheck


How to build a yum repository: Createrepo


Advanced usage of Yum Client configuration:


1, in the Yum customer definition warehouse can use cost to define the use of the warehouse, the default is 1000;

2. Variables can be used when specifying paths in BaseURL

$releasever: Major version number of the current OS release

$arch: Platform

$basearch: The basic platform , such as the I686,I586,I486,I386 series of basic platforms are i386;

$YUM 0-$YUM 9


Example: http://mirrors.sohu.com/centos/$releasever/os/$basearch

3. You can replace BaseURL with the mirrorlist directive:

Point to a URL, which is a text file that holds a large list of mirror servers, gets this list file when users use the Yum repository, and then uses the Fastestmirror plugin to determine which mirror is the fastest-to-access server and as the BaseURL for this visit ;


This article is from the "Shine" blog, make sure to keep this source http://664778789.blog.51cto.com/7534952/1582778

Linux Package Management 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.