How to Use CentOS yum

Source: Internet
Author: User

What is yum?
Yum = Yellow dog Updater, Modified
The main function is to conveniently Add/delete/update RPM packages.
It automatically solves the dependency problem of the package.
It facilitates management of a large number of system update Problems
Yum features
Multiple resource libraries can be configured simultaneously (Repository)
Simple configuration file (/etc/yum. conf
Automatically solves the dependency problem when rpm packages are added or deleted.
Easy to use
Maintain consistency with the RPM Database

Install yum
Built-in CentOS (yum-*. noarch. rpm)
# Rpm-ivh yum-*. noarch. rpm
Before you enable yum for the first time, 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 command
Note: When the yum or yum resource library is updated for the first time, yum will automatically download all the required headers and place them in the/var/cache/yum Directory, which may take a long time.

Rpm package update
Check the updatable rpm package
# Yum check-update
Update all rpm packages
# Yum update
Update the specified rpm package, such as updating the kernel and kernel source
# Yum update kernel-source
For large-scale version upgrades, unlike yum update, the old obsolete package is also upgraded.
# Yum upgrade

Installation and deletion of rpm packages
Install rpm packages like xmms-mp3
# Yum install xmms-mp3
Delete an rpm package, including packages that depend on the package
# Yum remove licq
Note: You will also be prompted to delete licq-gnome, licq-qt, and licq-text.

Parameters related to yum temporary storage (/var/cache/yum /)
Clear temporary rpm package files
# Yum clean packages
Clear temporary rpm header files
# Yum clearn headers
Clear the existing rpm header file
# Yum clean oldheaders
Clear existing rpm header files and package files
# Yum clearn or # yum clearn all
Note: equivalent to yum clean packages + yum clean oldheaders

Package list
List all rpm packages that can be installed or updated in the resource library
# Yum list
List specific rpm packages that can be installed, updated, and installed in the resource library
# Yum list mozilla *
Note: Match characters can be used in rpm package names, for example, to list all rpm packages starting with mozilla
List all updates to the rpm package in the resource library
# Yum list updates
List all installed rpm packages
# Yum list installed
List rpm packages installed but not included in the resource library
# Yum list extras
Note: download and install the rpm package from other websites

Rpm package information display (the info parameter is the same as the list)
Lists information about all rpm packages that can be installed or updated in the resource library.
# Yum info
Lists the specific information of rpm packages that can be installed or updated and installed in the resource library.
# Yum info mozilla *
Note: Match characters can be used in rpm package names, such as listing all rpm packages starting with mozilla
Lists information about all the rpm packages that can be updated in the resource library.
# Yum info updates
Lists information about all installed rpm packages.
# Yum info installed
Lists the installed rpm packages that are not included in the resource library.
# Yum info extras
Note: Download the installed rpm package information from other websites.

Search for rpm packages
Search for rpm packages matching specific characters
# Yum search mozilla
Note: Search for rpm package names and package descriptions
Search for rpm packages with specific file names
# Yum provides realplay

Add Resource Library
For example, add rpm.livna.org as the 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 *
Show Key information
# Rpm-qi gpg-pubkey-a109b1ec-3f6e28d5
(Note: If you want to delete the Key, use the # rpm-e gpg-pubkey-a109b1ec-3f6e28d5)

Common yum commands

# Install xxx software in yum install xxx

# Yum info xxx view xxx Software Information

# Yum remove xxx delete a software package

# Yum list listing software packages

# Yum clean

# Yum provides xxx search package with xxx As the keyword (the provided information is the keyword)

# Yum search xxx search package (name-based keyword)

# Yum groupupdate xxx

# Yum grouplist xxx

# Yum groupremove xxx

All three are in a group to perform the upgrade list and delete operations .. For example, "Mysql Database" is a group that operates all related software packages at the same time;

# Yum update system upgrade

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

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

# Yum list installed: list installed packages;

# Yun update kernel upgrade kernel;

Common sources of yum

1) automatically select the fastest Source

The speed of some mirror in yum is very slow. If yum chooses this mirror, yum will be very slow at this time. For this reason, you can download the fastestmirror plug-in, it automatically selects the fastest mirror:

# Yum install yum-fastestmirror

Configuration File: (do not change)/etc/yum/pluginconf. d/fastestmirror. conf

Speed Test record file of your yum image:/var/cache/yum/timedhosts.txt

(2) Use the yum

If the yum of the command line is inconvenient, you can use the graphical yumex, which looks more convenient, because you can freely choose the software Repository:

# Yum install yumex

Then you can see yum extender in the system tool. In fact, the system's built-in "Add/delete programs" can also achieve graphical software installation, but some yumex features it does not.

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.