Both RedHat and centos use Yum as the management tool for application software installation. Yum can be used in both GUI and command line modes to master common Yum commands, which is very convenient to use.
However, there is a problem with Yum usage. By default, the yum library directs to the Internet, and it is not very convenient for hosts to access the Internet when using a CD, you need to change the yum library to point to the CD media. In this way, it is very convenient to query and install the application software.
1. Modify
Take centos6.0 as an example. There are two files in the/etc/yum. Repos. d/directory.
CentOS-Base.repo and CentOS-Media.repo
The CentOS-Base.repo records the address and path information of the yum source on the network.
The CentOS-Media.repo records the media and paths that can be used locally as the yum source. There is also a description:
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a cdrom/DVD on
# CentOS-6. You can use this repo and Yum to install items directly off
# Dvd iso that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# Yum -- enablerepo = c6-media [command]
#
# Or for only the media Repo, do this:
#
# Yum -- disablerepo = \ * -- enablerepo = c6-media [command]
C6-media
Name = centos-$ releasever-Media
Baseurl = file: // media/centos
Gpgcheck = 1
Enabled = 0
Gpgkey = file: // etc/pki/rpm-GPG-key-beta
You only need to edit the bashurl and write your own CD path.
Ii. Use
You can use Yum -- disablerepo = \ * -- enablerepo = c6-media [command], where command can be info, install, and so on.
Iii. Example
For example, if we want to install Wireshark, a network communication packet capture software, on the host, this software is not installed by default.
Command: Yum -- disablerepo = \ * -- enablerepo = c6-media info Wireshark
The system feedback software has this software in the library c6-media and can be installed.
Command: Yum -- disablerepo = -- enablerepo = c6-media install Wireshark
The installation automatically solves the dependency problem and completes the installation.
The above methods are applicable to redhat5/6 and centos5/6 series.