YUM Detailed installation Configuration document
Introduction of Yum
1, Yum is what.
Yum = Yellow Dog Updater, Modified was originally developed by Yellow Dog, the developer of this release, Terra Soft, written in Python,
It was also called yup (Yellow Dog updater), which was later improved by the development team at Duke University.
Yum's mission is to automate upgrades, install/remove RPM packages, collect information about RPM packages, check dependencies, and automatically prompt users to resolve them.
The key point of Yum is to have a reliable repository, as the name suggests, this is the repository of software,
Warehouses can be HTTP or FTP sites, or local software pools, but must include RPM's header,header including the various information of the RPM package,
Includes descriptions, functions, provided files, dependencies, and so on. These headers are collected and analyzed to automate the remaining tasks.
If it is not installed, we will go to the address below to download the version of Yum that corresponds to our own system:
http://ayo.freshrpms.net/
The main function is more convenient to add/remove/update the RPM package.
It can automatically solve the problem of dependency of packages.
It can facilitate the management of a large number of system update problems
2, yum characteristics
Multiple resource pools can be configured at the same time (Repository)
Concise configuration files (/etc/yum.conf,/etc/yum.repo.d/youname.repo)
automatically resolves the dependency problems encountered when adding or removing RPM packages
Easy to use
Maintain consistency with the RPM database
3, yum Installation
CentOS Self Belt (yum-*.noarch.rpm)
#rpm-IVH yum-*.noarch.rpm
You first need to import the rpm-gpg-key of the system before you enable Yum for the first time:
Ii. configuration files for Yum
Yum configuration information is stored in a configuration file called yum.conf, usually located in the/etc directory, which is the total Yum configuration file.
Often a more flexible and convenient use is to create a new "custom name. Repo" Profile in the/etc/yum.repos.d/directory, removing the Rhel-debuginfo.repo from the system.
/etc/yum.conf configuration files are generally not changed, directly edit their own defined repo files
#############################################################
[Base]
name=red Hat Enterprise Linux $releasever-base
baseurl=http://ftp.monash.edu.au/pub/linux/centos/5.3/os/$basearch/
Gpgcheck=0
[UPDATE]
name=red Hat Enterprise Linux $releasever-updates
baseurl=http://ftp.monash.edu.au/pub/linux/centos/5.3/updates/$basearch/
Gpgcheck=0
[Extras]
name=red Hat Enterprise Linux $releasever-extras
baseurl=http://ftp.monash.edu.au/pub/linux/centos/5.3/extras/$basearch/
Gpgcheck=0
[Addons]
name=red Hat Enterprise Linux $releasever-addons
baseurl=http://ftp.monash.edu.au/pub/linux/centos/5.3/addons/$basearch/
Gpgcheck=0
############################################################
Parameter interpretation of configuration file:
[ServerID]
Name=some name for this server
baseurl=url://path/to/repository/
Gpgchkeck=1
ServerID is used to differentiate between different repository and must have a unique name. such as: [Base], [UPDATE], [extras], [addons]
Name, which is a description of repository, supports variables such as the $releasever $basearch.
BaseURL is the most important part of the server Setup, and only the correct settings can get the software from above.
There are three types of protocols supported by URLs: http://, ftp://, file://
BaseURL can be followed by multiple URLs such as:
baseurl=http://download.atrpms.net/mirrors/fedoracore/updates/$releasever/$basearch
http://redhat.linux.ee/pub/fedora/linux/core/updates/$releasever/$basearch
The gpgchkeck= has 1 and 2 options, representing whether or not a GPG check is performed, and if not, the default is checked.
Exclude=gaim
Failovermethod=priority
Several variables
$releasever, the release version is obtained from DISTROVERPKG in the [main] section, if not, based on the Redhat-release package.
$arch, CPU system, such as I686,athlon, etc.
$basearch, the basic system groups of CPUs, such as i686 and Athlon, belong to I386,alpha and alphaev6 with Alpha.
Import Gpg-key
RPM--import/usr/share/doc/redhat-release-*/rpm-gpg-key official software upgrades for use.
Third, upgrade the software with Yum
First, yum Update,
Yum will download the RPM header from the server's header directory, place it in the local cache, the header download is complete, yum will determine if there is an updatable package, then yum start downloading the package and use the invoke RPM installation, which may take some time, Depends on the number of software updates to update and network condition L
Upgrade completed, every day as long as the use of Yum check-update Check to see if there is any new
Upgrade a separate package with the Yum update packagename.
Iv. Practical Application
1, through the http://mirror-status.centos.org site to find their closest mirror site
Here I found the mirror near to me the site is Hong Kong's http://mirror.vpshosting.com.hk/pub/linux/centos/
2, my actual configuration file/etc/yum.repo.d/my.repo
###############################################################
[Base]
name=red Hat Enterprise Linux $releasever-base
baseurl=http://mirror.vpshosting.com.hk/pub/linux/centos/5.2/os/$basearch/
Gpgcheck=1
[UPDATE]
name=red Hat Enterprise Linux $releasever-updates
baseurl=http://mirror.vpshosting.com.hk/pub/linux/centos/5.2/updates/$basearch/
Gpgcheck=1
[Extras]
name=red Hat Enterprise Linux $releasever-extras
baseurl=http://mirror.vpshosting.com.hk/pub/linux/centos/5.2/extras/$basearch/
Gpgcheck=1
[Addons]
name=red Hat Enterprise Linux $releasever-addons
baseurl=http://mirror.vpshosting.com.hk/pub/linux/centos/5.2/addons/$basearch/
Gpgcheck=1
###############################################################
3, download and pour key
Cd/etc/pki/rpm-gpg
wget http://mirror.vpshosting.com.hk/pub/linux/centos/RPM-GPG-KEY-CentOS-5
RPM--import/etc/pki/rpm-gpg/rpm-gpg-key*
4, restart Yum
Service YUM-UPDATESD Restart
5, then you can use Yum to install the software package you want
Yum Install HTTP
If you are in a hurry to install the software, you may not need to update all the packages without Yum update.
FQA:
1, if the report
Warning:cannot Get exclusive lock On/var/lib/rpm/packages
Use: fuser/var/lib/rpm/* to see who is accessing the RPM database
V. Yum directives
Note: When an update is used for the first time using the Yum or Yum Repository, Yum automatically downloads all required headers placed in the/var/cache/yum directory, which may take a long time.
(1), RPM package update
* Check for updatable RPM packages
#yum check-update
* Update all RPM packages
#yum Update
* Update the specified RPM package, such as update kernel and kernel source
#yum Update Kernel Kernel-source
* Large-scale version upgrades, unlike Yum Update, even old obsolete packages are upgraded
#yum Upgrade
(2), the installation and removal of RPM package
* Install RPM packages, such as Xmms-mp3
#yum Install Xmms-mp3
* Delete the RPM package, including a dependent package with the package
#yum Remove Licq
* Note: At the same time will be prompted to delete Licq-gnome,licq-qt,licq-text
(3), Yum (/var/cache/yum/) Related parameters
* Clear the temporary storage of the RPM package file
#yum Clean Packages
* Clear the staging of the RPM header file
#yum Clearn Headers
* Clear the old RPM header files in the staging
#yum Clean Oldheaders
* Clean up the old RPM header files and package files in the staging
#yum Clearn or #yum clearn all
* Note: equivalent to yum clean packages + Yum clean oldheaders
(4), package list
* List all the RPM packages in the repository that can be installed or updated
#yum List
* List specific available RPM packages in the repository that can be installed or updated and installed
#yum list Mozilla
#yum List mozilla*
* Note: You can use matching characters in the RPM package name, such as listing all the RPM packages that start with Mozilla
* List all the RPM packages in the repository that can be updated
#yum list Updates
* List all the RPM packages that have been installed
#yum List installed
* List the RPM packages that have been installed but not included in the repository
#yum List Extras
* Note: Download the installed RPM package through other websites
(5), RPM package information display (info parameter with list)
* List all the RPM packages that can be installed or updated in the repository
#yum Info
* List specific information in the repository that can be installed or updated and installed RPM packages
#yum info Mozilla
#yum Info mozilla*
* Note: You can use matching characters in the RPM package name, such as listing all the RPM packages that start with Mozilla
* List all the RPM packages that can be updated in the repository
#yum Info Updates
* List all the RPM packages that have been installed
#yum Info installed
* List information about the RPM packages that have been installed but not included in the repository
#yum Info Extras
* Note: Download the installed RPM package information through other websites
(6), search RPM Package
* Search for the RPM package matching specific characters
#yum search Mozilla
* Note: in the RPM package name, package description, etc. search
* Search for RPM packages that contain specific file names
#yum provides Realplay
(7), the special use, uses the Yum to download installs, does not install.
Specifies the yum parameter--downloaddir, which is used in conjunction with--downloadonly to specify a different directory to store the downloaded package.
#yum Install--downloadonly--downloaddir=/tmp vsftpd
####################################################################################################
Additional additions: Add custom Repository
In the process of building a server, some of the tools we will use do not exist in the official library of Yum in CentOS, so we need to define Yum's unofficial library files so that some of the necessary tools can be installed through Yum.
# vi/etc/yum.repos.d/dag.repo← establishes Dag.repo, defines unofficial libraries
[Dag]
Name=dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
Gpgcheck=1
Enabled=1
# RPM--import http://dag.wieers.com/packages/rpm-gpg-key.dag.txt← Import Unofficial Library GPG
For example: Add rpm.livna.org as a resource pool
Install livna.org RPMs GPG key
#rpm--import Http://rpm.livna.org/RPM-LIVNA-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 delete key, use #rpm-e gpg-pubkey-a109b1ec-3f6e28d5)
Finish modifying the Yum configuration file
Reboot after modification: Pstree
Check to see if Yum is properly installed: Rpm-qa|grep Yum
[root@192 yum.repos.d]# pwd
/etc/yum.repos.d
[root@192 yum.repos.d]# Rpm-qa |grep Yum
Yum-rhn-plugin-0.9.1-48.el6.noarch
Packagekit-yum-plugin-0.5.8-21.el6.x86_64
Yum-utils-1.1.30-17.el6_5.noarch
Yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch
Yum-plugin-security-1.1.30-17.el6_5.noarch
Packagekit-yum-0.5.8-21.el6.x86_64
Yum-3.2.29-43.el6.centos.noarch
Yum-metadata-parser-1.1.2-16.el6.x86_64