The yum package management

The software upgrade is an upgrade of the software features and improved security, similar to the windows system, also need to regularly update the software upgrade under linux operating system, keeping software up to date. Linux operating system upgrades can be divided into manual and automatic upgrade upgrade in two ways: automatic upgrades are generally carried out under an authorization or a free linux distributions linux distro, just type upgrade command, the system will automatically complete the upgrade work without manual intervention.
yum is yellowdog updater modified acronym, yellow dog (yellow dog) is a Linux distribution version, but Redhat company will use this technology to upgrade their release on the formation of the current yum. linux yum is a tool commonly used automatic upgrade, with the Internet via the yum utility to automatically upgrade the system. For example, an authorized Redhat Linux operating system, or a Centos Linux systems, as long as your system can connect to the Internet, enter yum update can be automatically upgraded system. The essence of the system upgrade by yum yum command is to download the RPM package on the specified remote Internet hosts, and then automatically install, while addressing the dependencies between various software.
Manually upgrade is targeted for an upgrade system software, such as upgrading the system ssh login tools, gcc compiler tools. Manually upgrade is actually realized by the software update tool RPM package, so you may experience dependencies between software when upgrading software, upgrades relatively trouble.
The following specifically describes how to set the tool in yum Centos Linux4.4, the system automatically upgraded.
1. yum installation and configuration
(1) yum install
check yum has been installed:
[root @ localhost ~] # RPM -qa | grep yum
If the display indicates that the system has not installed the tool yum, yum centos installation package can be found in the optical disc system, to perform the installation instructions:
# RPM -ivh yum [the root @ localhost ~] - * .noarch.rpm.
Install yum We need the support package python-elementtree, python-sqlite, urlgrabber, yumconf etc. these packages installation CD Centos Linux systems can be found, if the dependencies between packages that appear in the yum installation process, simply follow the dependence tips to find the appropriate software package can be installed until the yum package installation is successful.
The following is an example of an installation environment:
[the root @ localhost ~] # 2.4.3-1.c4.noarch.rpm RPM -ivh yum-
warning: yum-2.4.3-1.c4.noarch.rpm: the DSA V3 Signature: NOKEY, Key ID 443e1821
error: the Failed Dependencies:
Python-ElementTree needed by IS-2.4.3-1.c4.noarch yum
Python-SQLite needed by IS-yum 2.4.3-1.c4.noarch
urlgrabber needed by IS 2.4.3-1.c4.noarch-yum
yumconf needed by IS-yum 2.4.3-1.c4.noarch
[the root @ localhost ~] # RPM -ivh Python-ElementTree-1.2.6-4.2.1.i386. rpm
warning: python-elementtree-1.2.6-4.2.1.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing... ########################################### [100%]
1:python-elementtree ########################################### [100%]
root@localhost ~]# rpm -ivh sqlite-3.3.3-1.2.i386.rpm
warning: sqlite-3.3.3-1.2.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing... ########################################### [100%]
1:sqlite ########################################### [100%]
[root@localhost ~]# rpm -ivh python-sqlite-1.1.7-1.2.i386.rpm
warning: python-sqlite-1.1.7-1.2.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing... ########################################### [100%]
1:python-sqlite ########################################### [100%]
[root@localhost ~]# rpm -ivh python-urlgrabber-2.9.8-2.noarch.rpm
warning: python-urlgrabber-2.9.8-2.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing... ########################################### [100%]
1:python-urlgrabber ########################################### [100%]
root@localhost ~]# rpm -ivh centos-yumconf-4-4.5.noarch.rpm
warning: centos-yumconf-4-4.5.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing... ########################################### [100%]
1:centos-yumconf ########################################### [100%]
[root@localhost ~]# rpm -ivh yum-2.4.3-1.c4.noarch.rpm
warning: yum-2.4.3-1.c4.noarch.rpm: V3 the DSA Signature: NOKEY, Key ID 443e1821
the Preparing ##################### ... ###################### [100%]
. 1: ##################### yum ###################### [100%]
(2) arranged yum
yum tool installed, the next task is to configure yum, yum configuration file main configuration file /etc/yum.conf, the repository configuration directory /etc/yum.repos.d,yum installation, the default configuration of some of the repository may not be available, and therefore need to be modified, the following is / etc / yum .repos.d / CentOS-Base.repo repository configuration file the detailed meanings:
[root @ localhost ~] # / etc / yum.repos.d / CentOS-Base.repo
[Base]
name = CentOS-4 - Base
#NAME is to release the name, its format "operating system name and version release", "base" indicates that this segment is looking for a base package information.

= baseurl http://mirror.centos.org/centos/4/os/$basearch/
#baseurl "represents yum find upgrade files on the Internet URL address where" $ basearch "represents the hardware architecture of the system, such as" i386 "," x86-64 and so on, at the same time, yum when updating resources, checks baseurl / repodata / repomd.xml file. "Repomd.xml" is an index file, its role is to provide an update rpm package file to download information and SHA checksum value. "Repomd.xml" includes three documents, namely "other.xml.gz", "filelists.xml.gz" and "primary.xml.gz", meaning indicated followed by "other update package list", " list centralized update files "and" major update the list of packages. "

= 1 gpgcheck
#gpgcheck indicate whether to enable gpg checks, 1 enables, 0 means no checking is enabled, if enabled, is the need to specify the location of GPG-RPM-KEY in the configuration file, you can see below gpgkey field, specify location GPG-RPM-KEY verification documents.

updates #released
[Update]
# update module updates this section is to use part of the configuration.
= the CentOS. 4-name - the Updates
BaseURL = http://mirror.centos.org/centos/4/updates/$basearch/
gpgcheck. 1 =
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY -centos4
#gpgkey specified GPG key address

Used #packages / Produced in But Not Released The Build
# specified in this paragraph is not yet released package portion (addons) Configuration
[addons]
name =-the CentOS. 4 - the Addons
BaseURL = http://mirror.centos.org/centos /. 4 / addons / $ basearch /
gpgcheck. 1 =
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

On May BE Useful Packages that #additional
# specified in this section are useful additional packages portion (Extras) Configuration
[Extras]
name =-the CentOS. 4 - Extras
BaseURL = http://mirror.centos.org/centos/4/extras / $ basearch /
gpgcheck. 1 =
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

Packages that Extend Functionality of #additional existing Packages
# specified in this paragraph is extended an additional package portion (CentOSPlus) Configuration
[CentOSPlus]
name =-the CentOS. 4 - Plus
BaseURL = http://mirror.centos.org/centos/4 / CentOSPlus / $ basearch /
gpgcheck. 1 =
Enabled = 0
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - Packages Centos by the Users
# here contrib part
[contrib]
name =-the CentOS. 4 - Contrib
BaseURL = http://mirror.centos.org/centos/4/contrib/$basearch/
gpgcheck. 1 =
Enabled = 0
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
2. yum features
 easy installation, automatic dependency solve problems encountered when to add or remove rpm package.
 You can configure multiple resource library (Repository)
 simple configuration file (/etc/yum.conf,/etc/yum.repos.d/CentOS-Base.repo)
 maintain consistency with the RPM database
Note: yum It will automatically download all the resources required for the upgrade package and placed in default under / var / cache / yum directory, or when yum yum repository update for the first time, the time required for the software upgrade may take longer.
3. yum daily usage of
(1) to install and remove RPM package yum
l rpm installation package, such as DHCP
[root @ localhost ~] #yum the install DHCP
l remove rpm package, including the package has a dependent package
[root @ localhost ~ ] #yum remove licq
Note: At the same time will be prompted to remove the GNOME-for licq, for licq-qt, for licq-text
(2) update package through yum utility
 examination can update rpm package:
[root @ localhost ~] # yum the Check-Update
 update all rpm packages:
[root @ localhost ~] # yum update
 update the specified rpm package, such as updating Source kernel and kernel:
[root @ localhost ~] # yum Source update kernel kernel-
scale version  upgrade with yum update different that old out of the package will be upgraded:
[root @ localhost ~] # yum upgrade
(3) RPM package information inquiries via yum
lists all the information repository can install or update rpm package of l:
[root @ localhost ~] # yum info
l lists the specific repository and can be installed or updated information has been installed rpm package:
[root @ localhost ~] # yum info vsftpd
[root @ localhost ~] # yum info perl
Note: You can rpm package name used in sign, as the above examples are listed in the beginning of all information packets Perl rpm.
 lists all of the information that can be updated rpm package repository:
[root @ localhost ~] # yum info the Updates
 lists all installed rpm packages of information:
[root @ localhost ~] #yum info installed
information listed  rpm package has been installed but is not included in the repository:
[root @ localhost ~] # yum info Extras
Note: rpm installation that is downloaded by other sites packets.
 list all the possible update of rpm package repository:
[root @ localhost ~] # yum List the Updates
 list all rpm packages installed:
[root @ localhost ~] # yum List Installed
 listed already installed but rpm package is not included in the repository:
[root @ localhost ~] # yum List Extras
Note: that is downloaded and installed through other sites rpm package.
 List all you can install or update rpm package repository:
[root @ localhost ~] # yum List
 lists specific repository can be installed or updated and installed rpm packages:
[root @ localhost ~] # List the sendmail yum
[the root @ localhost ~] #yum List gcc

Note: You can use the matcher rpm package name, as all of the above examples are listed beginning gcc rpm package.
For more information matches specific character of the rpm package  Search:
[root @ localhost ~] # yum Search wget
Note: You can "search" in the rpm package name, search the package description.
L rpm package containing specific search file name:
[the root @ localhost ~] #yum the Provides realplay
(. 4) by the operation yum staging information (/ var / Cache / yum)
l clear rpm buffered package file:
[the root @ localhost ~] # yum Clean Packages Standard Package
l Clear the temporary head of the rpm file:
[root @ localhost ~] # yum Clean headers
l Clear scratch in the old rpm header file:
[root @ localhost ~] # yum Clean oldheaders
l Clear scratch rpm in the old file and the package file header:
[the root @ localhost ~] #yum Clean or
[root @ localhost ~] #yum clean all
Note: the above two commands corresponds yum clean packages + yum clean oldheaders.
4. Redhat Linux system under a yum upgrade
yum can also upgrade Redhat Linux systems, the default installation package is not yum Redhat Linux system installation disk, due Redhat Linux and Centos Linux basically the same, so you can use the same version of Centos Linux kernel with yum package for installation on Redhat Linux. The installation process has been covered in the previous section, there is not much to say.
The use of the installation of Centos Linux yum package in Redhat Linux, so in Redhat Linux need to increase the resource base, the definition of yum unofficial libraries, so that some required packages can be installed via yum.
Firstly dag.repo, defined unofficial library:
[root @ localhost ~] # vi /etc/yum.repos.d/dag.repo
[DAG]
name = Dag RPM Repository for RHEL4
baseurl = HTTP: //ftp.riken .jp / Linux / DAG / RedHat / EL4 / EN / $ basearch / DAG /
Enabled = 1
gpgcheck = 1
then import the unofficial repository GPG:
[root @ localhost ~] # RPM --import \
HTTP: // the FTP. riken.jp/Linux/caos/centos/RPM-GPG-KEY-centos4
Note: this step is very important, if there is no import authorization RPM-GPG-KEY, when using yum upgrade installation software will prompt illegal software, combined with context can be seen, when carried out under Centos yum configuration, and not related to import RPM-GPG-KEY, it is because the repository connections for Centos official library, and upgrade the system also Centos, of course, without an authorization, and here we upgraded system is Redhat Linux, and the resource file is Centos, it must import Centos of RPM-GPG-KEY, the system was considered an upgrade package is legitimate.
Finally, you can use the unofficial definition rpm package to upgrade the system:
[root@localhost ~]#yum update

Guess you like

Origin blog.51cto.com/13369003/2424350