CentOS6.5 local yum source and network yum source are used simultaneously

Source: Internet
Author: User
1. local yum source 1. the system has installed a software package that can use yum by default, so you can directly configure: [root @ localhost ~] # Cd/etc/yum. repos. d/& nbs

1. local yum source

1. the system has installed the yum software package by default, so you can directly configure it:

[Root @ localhost ~] # Cd/etc/yum. repos. d/yum source configuration file directory

 

[Root @ localhost yum. repos. d] # mv CentOS-Base.repo CentOS-Base.repo.bak first rename the network yum source configuration file (invalidate it)

[Root @ localhost yum. repos. d] # vim CentOS-Media.repo edit local yum source file

 

C6-media

Name = CentOS-$ releasever-Media local yum source name (can be modified at will)

Baseurl = file: // mnt/sr0 disk Mount directory/mnt/sr0

Gpgcheck = 1

Enabled = 1 use this yum source (0 is not enabled)

Gpgkey = file: // mnt/sr0/RPM-GPG-KEY-CentOS-6 local yum source key

 

II. network yum source (the premise is that you must be connected to the internet. The yum source used here is the address of the University of Science and Technology of China:

University of Science and Technology: http://centos.ustc.edu.cn/centos)

[Root @ localhost yum. repos. d] # mv CentOS-Base.bak CentOS-Base.repo if you did not change the name before you do not need to perform this step

[Root @ localhost yum. repos. d] # vim CentOS-Base.repo edit network yum source file

 

[Base]

Name = CentOS-$ releasever-Base

# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS

Baseurl = http://centos.ustc.edu.cn/centos/?releasever/ OS /?basearch/

Gpgcheck = 1

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

 

# Released updates

[Updates]

Name = CentOS-$ releasever-Updates

# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates

Baseurl = http://centos.ustc.edu.cn/centos/?releasever/updates/?basearch/

Gpgcheck = 1

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

 

# Additional packages that may be useful

[Extras]

Name = CentOS-$ releasever-Extras

# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras

Baseurl = http://centos.ustc.edu.cn/centos/?releasever/extras/?basearch/

Gpgcheck = 1

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

 

# Additional packages that extend functionality of existing packages

[Centosplus]

Name = CentOS-$ releasever-Plus

# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus

Baseurl = http://centos.ustc.edu.cn/centos/?releasever/centosplus/?basearch/

Gpgcheck = 1

Enabled = 0

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

 

# Contrib-packages by Centos Users

[Contrib]

Name = CentOS-$ releasever-Contrib

# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib

Baseurl = http://centos.ustc.edu.cn/centos/?releasever/contrib/?basearch/

Gpgcheck = 1

Enabled = 0

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


III. notes:

It is recommended that only one yum source be valid when yum is used, because the network yum source is used by default.

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.