Basic use of Yum under Linux

Source: Internet
Author: User
Tags yum repolist

1. Introduction

Yum:yellowdog Update modifier,rpm's front-end program, used to resolve package dependencies, can locate packages among multiple libraries, up2date alternative tools.

Yum's basic workgroup needs to depend on the Yum repository: Yum repository (yum repo)

Storage of many RPM packages and related metadata files for packages (placed in a specific directory: Repodata);

2. Yum Client configuration file

/ETC/YUM.CONF: Providing public configuration for all warehouses

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

Definition of Warehouse point:

[Repositoryid]

Name=some name for this repository

Baseurl=url://path/to/repository

ENABLED={1|0} defaults to 1

GPGCHECK={1|0} default 1

Gpgkey=url

Enablegroups={1|0}

Failovermethod={roundrobin|priority} defaults to Roundrobin, which means random selection

cost= Default 1000

Cases:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/82/2B/wKioL1dNVUiSWLBGAADwurOjcbc849.png "title=" Yum.conf "alt=" Wkiol1dnvuiswlbgaadwurojcbc849.png "/>


3. Yum Store (yum repo)

In general, warehouses are file servers that can be serviced through the following Parties:

ftp://

/ http

nfs://

file:///

Create a yum warehouse: Createrepo [Options] <directory>

4. Use of Yum related commands

Yum [options] [command] [pckage ...]

Yum-config-manager--ADD-REPO=FILE:///MISC/CD generating Warehouse files Misc_cd.repo

Yum-config-manager--disable "MISC_CD" Disable the Warehouse

Yum-config-manager--enable "MISC_CD" Enable warehouse

Yum repolist [All | enabled | disabled] Show warehouse list

Yum List Display Package

#yum list [All | glob_exp1] [GLOB_EXP2] [...]

#yum List {avaliable | installed | updates} [glob_exp1][...]

To install the package:

Yum install Package1 [Package2] [...]

Yum Reinstall Packge1 [Package2] [...] re-install

Upgrade Package:

yum Update [package1] [Package2] [...]

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

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

Build cache:

Yum Makecache

Search:

Search string1 [string2] [...] searches for packages and summary information with the specified keywords;

View the capabilities that the specified package depends on:

Yum deplist package1 [Package2] [...]

View Yum things history:

Yum History [Info | list | packages-list | packages-info | summary | addon-info | redo | undo | rollback | new | sync | s Tats]

Yum history

Yum History Info 6 View more information about 6

Yum History undo 6 undo Record 6 Operation

To install and upgrade the local package:

Localinstall Rpmfile1 [rpmfile2][...]

Localupdate Rpmfile1 [rpmfile2][...]

Note: In order to be compatible with existing commands, use Install,update directly after 6.0

Package group Management Related commands:

Groupinstal group1 [group2][...]

Groupupdate group1 [group2][...]

grouplist [hidden] [groupwildcard][...]

Groupremove group1 [group2][...]

GroupInfo group1 [...]

Yum command-Line options:

--nogpgcheck: No GPG check

-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

Log file:/var/log/yum.log


5. Example: Use CD as local Yum warehouse (CentOS6.7 system)

Note: Because Repodata is present by default in the disc directory, you do not have to create the Yum library manually, and if you use a local directory, you should use Createrepo [options] <directory> command creation.

① mounting discs to a directory

#mount/dev/cdrom/media/cdrom

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/82/2D/wKiom1dNVJqC4ztyAAAQWlqadUg033.png "title=" Mount " alt= "Wkiom1dnvjqc4ztyaaaqwlqadug033.png"/>

② Creating a configuration file

#vim/etc/yum.repo.d/centos6.repo

[CentOS6]

Name=centos6-yum

Baseurl=file:///media/cdrom

gpgcheck=0

Enabled=1

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/82/2B/wKioL1dNVCjzqgJPAAAdKt0-l94166.png-wh_500x0-wm_3 -wmp_4-s_2625303306.png "title=" Create Profile "alt=" Wkiol1dnvcjzqgjpaaadkt0-l94166.png-wh_50 "/>

③ using Yum repolist to see if the creation was successful

#yum repolist

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/2D/wKiom1dNVMCg4fvdAABnXl-8w1U326.png "title=" Repolist "alt=" Wkiom1dnvmcg4fvdaabnxl-8w1u326.png "/>

④ test: Installing the tree program with Yum

#yum-y Install tree

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/82/2D/wKiom1dNU-6SK3D4AABi5bSEwUs670.png-wh_500x0-wm_3 -wmp_4-s_2565748964.png "style=" Float:none; "title=" Install "alt=" Wkiom1dnu-6sk3d4aabi5bsewus670.png-wh_50 "/>

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/82/2B/wKioL1dNVOvjStmqAABqjB08eRQ184.png-wh_500x0-wm_3 -wmp_4-s_1955733672.png "style=" Float:none; title= "History" alt= "Wkiol1dnvovjstmqaabqjb08erq184.png-wh_50"/>


This article is from the "./" blog, be sure to keep this source http://dd0328.blog.51cto.com/11619665/1784928

Basic use of Yum under Linux

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.