Configure local Yum source and network Yum source under CentOS 6.6

Source: Internet
Author: User
Tags gpg

First, local Yum source

1, the system is installed by default can use Yum package, so you can directly configure:

[[email protected] ~]# Cd/etc/yum.repos.d/yum Source configuration file Drop directory

[[Email protected] yum.repos.d]# mv Centos-base.repo Centos-base.repo.bak First rename the network Yum source profile (to invalidate it)

[[email protected] yum.repos.d]# vim Centos-media.repo edit local Yum source file

[C6-media]

name=centos-$releasever-media Local Yum Source name (optionally modifiable)

BASEURL=FILE:///MNT/SR0 CD-ROM mount directory/mnt/sr0

Gpgcheck=1

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

Gpgkey=file:///mnt/sr0/rpm-gpg-key-centos-6 Local Yum Source key

Second, simple configuration of domestic network yum source

NetEase (163) Yum Source is one of the best yum sources in the country, both speed and software version is very good, the Yum source is set to 163yum, can increase the speed of package installation and update, while avoiding some common software version cannot be found. Here's how to set it up:

1, enter the Yum source configuration directory
Cd/etc/yum.repos.d

2, the backup system comes with the Yum source
MV Centos-base.repo CENTOS-BASE.REPO.BK
Download 163 NetEase's Yum Source:
wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo

3, after updating the Yum source, perform the following command to update the Yum configuration so that the operation takes effect immediately
Yum Makecache

4, in addition to NetEase, there are other good sources of Yum, such as Zhong Ke and Sohu, we can download according to their own needs
Zhong Ke's yum Source:
wget Http://centos.ustc.edu.cn/CentOS-Base.repo
Sohu's Yum Source
wget Http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

In theory, these Yum source Redhat systems and fedora are also available, but they are not tested and need to be tested by the webmaster themselves.

Third, the network of Yum source (if you must be able to connect to the Internet, the Yum source used here is the Chinese University of Science and Technology address as follows:

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

[Email protected] yum.repos.d]# mv Centos-base.bak Centos-base.repo do not use this step if you have not renamed it before

[[email protected] yum.repos.d]# vim Centos-base.repo Edit network Yum source file

[Base]

name=centos-$releasever-base

#mirrorlist =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

#mirrorlist =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 could be useful

[Extras]

name=centos-$releasever-extras

#mirrorlist =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

#mirrorlist =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

#mirrorlist =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


Iv. Matters needing attention:

When using Yum, it is best to have only one Yum source in effect, because the system defaults to using the network Yum source.

Five,

Now that the Yum installation is complete,

Before the Yum install installer, it is recommended that you enter the following instructions first

#yum Clean All

#yum Update

# # # This on all excerpts with the network

Configure local Yum source and network Yum source under CentOS 6.6

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.