One, what is Yum
Yum is the abbreviation for "Yellow Dogupdater, Modified", and the executable program name is yum. Yum is a shell front-end package manager in Fedora and Redhat as well as SuSE and CentOS. One of the important reasons for introducing Yum in the Red Hat Enterprise Linux 5 is yum can automatically download the RPM package from the specified server and install, can automatically handle dependency relationship, and install all dependent software packages at once, without tedious downloading, installation, easy to manage a large number of system update problems.
Second, why to use Yum
Using Yum to install packages is much more convenient than installing packages using the RPM command. The main point, I think, is that Yum can automatically solve the dependency relationship. People who have used Linux to install binary packages should have encountered the dependencies between RPM packages, especially the cycle dependencies, which is a real headache, sometimes having to waste a whole day in order to install a software package. Yum automatically resolves dependencies, shortening the time it took to install packages, and improving productivity, how can a guy like that be a creature of love? Yum can also use a command to upgrade all software packages on the system directly, you say, do not love her who do you love.
Iii. How to use Yum
The use of Yum is actually very simple, we just need to install the Yum package, and then change the Yum source configuration file, you can automatically download the package from someone else's Yum source, and then automatically install. However, the significance of this article is not to teach you to change the configuration file, and then install the Yum package, and then use the Yum command to install the package, but to do their own, do their own Yum source, their own use of the Yum source, fully understand the Yum working principle.
Iv. composition and working principle of Yum
Yum is composed of two parts, part of the Yum source (or Yum Warehouse | is actually a package warehouse), and the other part is the Yum client, which is to install Yum software, can use the Yum command client.
When we use the Yum command to install a package, Yum will locate the Yum source according to the Yum configuration file (/etc/yum.repos.d/*.repo), and then download the data files on the Yum source to the local cache, so that the query can be increased faster. Only the first time the cached file is downloaded. Once completed, if the package to be installed is in the Software warehouse, then start depending on the definition on the server dependencies file, see if there are dependencies on other packages, if there is, will prompt the user has dependencies, is not to install, users answer y, start automatically resolve dependencies until the installation of the package. If there is no dependency, will also prompt the user, found the package to install, is not installed now, if the user entered Y, then start the installation, if the direct return, the default is not installed. A yum command will open a Yum transaction, so if you are executing the Yum command, and then someone is logged in to the server you are in, then he is unable to execute the Yum command, at which point the Yum process is locked, and only when your Yum command is completed and the transaction ends, Other people can use the Yum command.
V. Configuration of Yum
5.1 Configuring the Client
The client's configuration is two steps, one is to install the software package, the other is to change the configuration file
I have installed the above software package on my machine, it can be installed directly using RPM-IVH, after the installation completes, this step is finished
5.1.2 Change Configuration file
The Yum configuration file has two parts: the primary configuration file and the Yum source profile
Primary configuration file
[Root@honway ~]# cat/etc/yum.conf
[Main]
Cachedir=/var/cache/yum Cache Directory
Keepcache=0 whether to save the cache
debuglevel=2 Debug Level
Logfile=/var/log/yum.log log File
Distroverpkg=redhat-release
Tolerant=1 Allow error (if there are multiple packages, if a package has been installed, continue, 1 for permission)
Exactarch=1
Obsoletes=1
Gpgcheck=1 installation, is not the detection of the detection package signature information
Plugins=1 Enable plug-in functionality
Let's take a look at how yum specifies the yum source, the file is located in the/etc/yum.repos.d/directory where all files ending in. Repo are yum yum source configuration files that are considered yum. The wording is as follows
[ID]
Name=custmed Yum Repository
Baseurl=ftp://192.168.0.254/pub/server
gpgcheck=0[0 Disable |1 enabled]
enabled=0[0 disable |1 enabled] (default on, the entry is not written)
Where ID is a name, you can write casually.
Name is a descriptive information about the ID.
BaseURL Here are three ways of writing, but also represents the Yum supported three kinds of protocols, remote protocol has ftp://and http://, the local Yum source file:///is three slash
Gpgcheck is not the test signature
Enabled is not to enable this, a Yum.repo configuration file, you can write a number of entries, each of which starts with [ID], each [ID] can be considered a separate segment