About Yum configuration in centos 7

Source: Internet
Author: User
Tags gpg

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.


  1. 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

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.