You need to install some components during the centos test. There are two ways to install them:
(1) install with RPM (for a small number of components)
(2) install with Yum (for a large number of installations)
Everyone knows that RPM installation is only suitable for installing a small number of components. If a large number of components are installed with rpm, yum can take advantage of its convenient advantages, so how to configure yum? The following describes how to configure yum.
-
Enter the following command
# Vi/etc/yum. Repos. d/CentOS-Base.repo
2. Modify the CentOS-Base.repo File
Color part of the file
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and
# Update Status of each mirror to pick mirrors that are updated to and
# Geographically close to the client. You shoshould use this for centos updates
# Unless you are manually picking other mirrors.
#
# If the specified list = does not work for you, as a fall back you can try
# Remarked out baseurl = line instead.
#
#
[Base]
Name = centos-$ releasever-Base
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
# Baseurl = http://developer.centos.org/centos/?releasever/ OS /?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-7
# Released updates
[Updates]
Name = centos-$ releasever-Updates
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
# Baseurl = http://developer.centos.org/centos/?releasever/updates/?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-7
# Additional packages that may be useful
[Extras]
Name = centos-$ releasever-extras
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
# Baseurl = http://developer.centos.org/centos/?releasever/extras/?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-7
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = centos-$ releasever-plus
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
# Baseurl = http://developer.centos.org/centos/?releasever/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-7
Change
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and
# Update Status of each mirror to pick mirrors that are updated to and
# Geographically close to the client. You shoshould use this for centos updates
# Unless you are manually picking other mirrors.
#
# If the specified list = does not work for you, as a fall back you can try
# Remarked out baseurl = line instead.
#
#
[Base]
Name = centos-$ releasever-Base
Baseurl = file: // MNT/CDROM/
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // etc/pki/rpm-GPG/RPM-GPG-KEY-CentOS-7
3. Start Installation
# Mkdir/mnt/CDROM
# Mount/dev/CDROM/mnt/CDROM/
Mount: block device/dev/sr0 is write-protected, mounting read-only
# Cd/mnt/CDROM/packages/
# Yum-y install Component name (it is best to first ls component name * To see if there are any of these components)
This article from the "Haina baichuan academic unbounded" blog, please be sure to keep this source http://9281308.blog.51cto.com/9271308/1542474