Replace the yum source and build the yum local ground source server in centos 6.5

Source: Internet
Author: User
Tags yum repolist aliyun

1. Change Source

Well, for all the reasons, the download speed of many yum source paths provided by centos is very slow. So, change the source.

# cd /etc/yum.repos.d
# cp CentOS-Base.repo CentOS-Base.repo.backup# vim CentOS-Base.repo

Under normal circumstances, the CentOS-Base.repo file is used to obtain the Source Path listing and then download the source package, don't worry about him, delete these lines

 

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

 

 

Remove the following lines #

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

Then, replace pai.centos.org with the address of the domestic source server.

For example, change to Alibaba Source

baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearchbaseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/

There are some good source servers in China

Zhongke dayuan/

2. Build local ground source servers

It is immoral to download things when there are many people in the lab, so it is very troublesome to build a server to download things. However, no one was using the lab network at night, so I wanted to build a local ground source server to facilitate the quick update of my brother, sister, and younger siblings.

First download two software # Yum install createrepo httpd

Then start the HTTP server
# Service httpd start
# Chkconfig httpd on

Go to the HTTP directory
CD/var/www/html/
Mkdir centos
CD centos

Show source list
# Yum repolist

Usually base, update, extras, epel, etc.

Select a download, all download
# Reposync -- repoid = base

After the download is complete, several more folders will be displayed in the current folder. Modify the user group and permissions.

# Chown-r yourname: yourgroup/var/www/html/centos
# Chmod-r 755/var/www/html/centos

Use the following command to create a file library in each directory of centos
$ Createrepo/var/www/html/centos/base

After successful modification, you can modify the path in the. Repo file.
[base]
……
baseurl=http://localhost/centos/base
……
[update]
……
baseurl=http://localhost/centos/update
……
 
[extras]
……
baseurl=http://localhost/centos/extras
……
 
 
 

 

Replace the yum source and build the yum local ground source server in centos 6.5

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.