(CentOS) Program installation package management: Yum

Source: Internet
Author: User

Brief introduction:

Yum (full name Yellow dog Updater, Modified) is a shell front end package Manager in Fedora and Redhat and CentOS. 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 configuration file:

Master profile:/etc/yum.conf (valid for all Yum repositories)

Definitions for each warehouse:/etc/yum.repos.d/*.repo (only valid for own warehouse, priority is greater than the Master profile.) )

As below, we create a yum library ourselves:

[Testrepo]: Represents the warehouse unique identification ID

Name: Current Warehouse Brief introduction information

BaseURL: The URL address of the Warehouse (FTP | HTTP | Local directory)

Gpgcheck: Whether to check the package (1 is | 0 NO)

Enabled: Whether the warehouse is available

Yum command:

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]

* Load-transaction [Txfile]

* Check

* Help [command]

Introduce several common parameters:

Warehouse Management:

repolist: List all available warehouses that have been configured

repolist [all|enabled|disabled]

Cache Management:

Clean: Cleanup cache

Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]

Makecache: Cache creation

automatically connect to each available warehouse, download its metadata, and create it as a cache

Package View:

Yum list [All | glob_exp1] [GLOB_EXP2] [...]

Wildcard characters are supported, for example: Yum list php*--view packages at the beginning of PHP

yum list {available|updates|installed|extras|obsoletes} [GLOB_EXP1] [...]

Condition lookup, viewing packages, for example: available (valid package), installed (installed package)

grouplist [Hidden] [Groupwildcard] [...]

Package Installation: Install Package1 [Package2] [...]

Attention:

Only the package name needs to be provided;

If a package has several different versions in different warehouses, the latest version is installed by default;

If you are installing the specified version: Install package-version ...

Reinstall (overwrite installation) reinstall Package1 [Package2] [...]

Package Upgrade: Update [PACKAGE1] [Package2] [...]

Package demotion: Downgrade Package1 [Package2] [...]

Check which upgrades are available: Check-update

Package Uninstall:

Remove | Erase package1 [PACKAGE2] [...]

all packages that depend on the package being uninstalled will be uninstalled;

Package query:

Brief information about the query program: INFO package ...

Example: Yum info php (see PHP for brief information)

Search for the specified keyword in the package name and sumary information: Searching KEYWORD ...

For example: Yum search php (check for the PHP keyword in the summary information)

Query which package the specified file is installed on build: Provides|whatprovides/path/to/somefile

For example: Yum provides/etc/inittab (check inittab This file is generated by which package)

Package Group Management:

List all package groups: Grouplist

Show specified package group details: GroupInfo group1 [...]

Installation: Groupinstall group1 [group2] [...]

Uninstall: Groupremove group1 [group2] [...]

Upgrade: Groupupdate group1 [group2] [...]

Note: After CentOS 7, you can manage the package group directly with Install,remove or update, plus (@) before the group name.

For example: Yum install @ "Server Platform Development" (Installation Sever Platform development package)

Other options for the Yum command:

-Y: Auto Answer "yes"

--disablerepo=: Temporarily disable the warehouse configured in the configuration file

--enablerepo=: Temporarily enable a warehouse that specifies not enabled

--nogpgcheck: Do not do package verification

Yum built-in variables:

(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

For example: The current system is CentOS 6.6 x86_64

baseurl=http://repo.magedu.com/centos/$releasever/$basearch (this is the same as the wording below)

Http://repo.magedu.com/centos/6/x86_64

(CentOS) Program installation package management: 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: 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.