RedHat, centos system Yum local software library settings

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.