Install the yum source on the attached disc of each CentOS version

Source: Internet
Author: User
Mount/dev/cdrom/media ## Centos5 # vi/etc/yum. repos. d/CentOS-Base.repo [c5-media] name = CentOS-$ releasever-Mediabaseurl = file: // media/gpgcheck = 1 enabled = 1

Mount/dev/cdrom/media

# Centos5 ##

Vi/etc/yum. repos. d/CentOS-Base.repo

C5-media

Name = CentOS-$ releasever-Media

Baseurl = file: // media/

Gpgcheck = 1

Enabled = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

# Gpgcheck = 1 ----> whether to enable check GPG-KEY

# Enabled = 1 ----> whether to enable YUM source

# Pgkey = *** ----> specifies the GPG-KEY file in the Mount Directory

 

# CentOS_6 ##

Vi/etc/yum. repos. d/CentOS-Media.repo

C6-media

Name = CentOS-$ releasever-Media

Baseurl = file: // media/CentOS/

# Add or modify to the following lines ##

File: // media/

Gpgcheck = 1

Enabled = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

 

# CentOS_7 ##

[Cdrom]

Name = CentOS7-cdrom

Baseurl = file: // media/

Enable = 1

Gpgcheck = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

 

 

Clear Cache and create new cache

[Root @ localhost ~] # Yum clean all (clear cache)

[Root @ localhost ~] # Yum makecache (new cache)


CentOS_6 build a local disc YUM source

Http://www.centoscn.com/image-text/config/2014/0629/3223.html

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.