How to use CentOS yum in detail

Source: Internet
Author: User
Tags gpg

What is Yum?
Yum = Yellow Dog Updater, Modified
The main function is more convenient to add/remove/update RPM packages.
It can automatically solve the dependency problem of the package.
It makes it easy to manage a large number of system update issues
Yum Features
Multiple repositories can be configured at the same time (Repository)
Concise configuration file (/etc/yum.conf
Automatic resolution of dependency issues encountered when adding or removing RPM packages
Easy to use
Maintaining consistency with the RPM database

Yum Installation
CentOS comes with (yum-*.noarch.rpm)
#rpm-IVH yum-*.noarch.rpm
Before you first enable Yum, you first need to import the system's Rpm-gpg-key:
#rpm--import/usr/share/doc/centos-release-3 (4)/rpm-gpg-key-centos-3 (4)

Yum Instructions
Note: When using the Yum or Yum repositories for the first time, Yum will automatically download all required headers placed in the/var/cache/yum directory, which may take a long time.

Update for RPM packages
Check for updatable RPM packages
#yum check-update
Update all RPM Packages
#yum Update
Update specified RPM packages, such as update kernel and kernel source
#yum Update Kernel Kernel-source
A large-scale version upgrade, unlike Yum Update, even the old obsolete package is upgraded
#yum Upgrade

Installation and removal of RPM packages
Install RPM packages, such as Xmms-mp3
#yum Install Xmms-mp3
Remove RPM packages, including packages that are dependent on the package
#yum Remove Licq
Note: You will also be prompted to delete Licq-gnome,licq-qt,licq-text


#yum clean packages
clear the staging RPM header file
#yum clearn headers

#yum clean oldheaders

#yum Clearn or #yum clearn all
note: equivalent to Yum Clean packages + Yum clean oldheaders

package list



#yum list Mozilla#yum list mozilla*
note: You can use a match in the RPM package name, such as listing all RPM packages that start with Mozilla

#yum list updates

#yum list installed
list RPM packages that have been installed but not included in the repository
#yum list Extras
note: Download the installed RPM package from other websites

rpm Package information display (info parameter with list)

#yum info

#yum info Mozilla#yum Info mozilla*
Note: You can use a match in the RPM package name, such as listing all the RPM packages that start with Mozilla

#yum info updates

#yum info installed

#yum info Extras
Note: Download the information for installed RPM packages from other websites

search RPM package

#yum search Mozilla
Note: Search for the RPM package name, package description, and so on
search for RPM packages with a specific file name
#yum provides Realplay

Add Resource Library
Example: Add rpm.livna.org as a resource library
Install livna.org RPMs GPG key
#rpm--import Http://rpm.livna.org/RPM-LIVNA-GPG-KEY
Check GPG Key
# Rpm-qa gpg-pubkey*
Display key Information
#rpm-qi Gpg-pubkey-a109b1ec-3f6e28d5
(Note: If you want to remove key, use #rpm-e gpg-pubkey-a109b1ec-3f6e28d5)

Common commands for Yum

# yum install xxx installation XXX software

# yum info xxx view XXX software information

# yum Remove xxx Remove package

# Yum List List of packages

# Yum Clean clears buffers and on-the-go packages

# yum provides xxx with XXX keyword search package (provided information for keywords)

# Yum Search XXX Searches packages (keywords by name)

# yum Groupupdate xxx

# yum Grouplist xxx

# yum Groupremove xxx

These three are all a set of upgrade lists and deletions for the organization: For example, "Mysql Database" is a group that will operate all related packages at the same time;

# Yum Update system upgrade

# Yum list available lists all packages on the upgrade source;

# The Yum list updates list all the update packages available on the upgrade source;

# The Yum list installed lists the packages that have been installed;

# Yun update kernel upgrade kernel;


Common sources for Yum

1) automatic selection of the fastest source

Because Yum has mirror speed is very slow, if Yum chooses this mirror, this time Yum will be very slow, in this case, you can download the Fastestmirror plugin, it will automatically select the fastest mirror:

#yum Install Yum-fastestmirror

Configuration file: (generally not moving)/etc/yum/pluginconf.d/fastestmirror.conf

Speed Test log file for your yum Image:/var/cache/yum/timedhosts.txt

(2) Yum with graphical interface

If you feel that the command line Yum is inconvenient, then you can use the graphical Yumex, which looks more convenient because you are free to select repositories:

#yum Install Yumex

The Yum Extender can then be seen in the system tools. In fact, the system comes with the "Add/Remove Programs" can also achieve graphical software installation, but some Yumex features it does not.

How to use CentOS yum in detail

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.