HTTP way to build local Yum source server

Source: Internet
Author: User

1. replace Ali Source

Mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.backup

Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repo

#下载阿里的yum源

#如出现无法找到下载包, you need to install Epel

Yum Install Epel-release

Yum Clean All

Yum Makecache

2. enable yum cache

Vim/etc/yum.conf

Modify

Keepcache=1

3. Download Yum pack

Yum Update

Mkdir/home/download

Find/var/cache/yum / -name ' *.rpm ' |xargs-i cp-f {}/home/download

Cd/home/download

Createrepo.

4. establishing a yum server

#启动http服务

service httpd restart

chkconfig httpd on

#拷贝download文件夹到/var/www/html/directory

cp/home/download/*/var/www/html/

Web site Access http://IP/download/, if you can open the file list, the success

5. Installing the server repo configuration

cd/var/yum.repo.d/

RM-RF centos-*

Vim/etc/yum.repos.d/centos.repo

[CENTOS6]

name=centos-$releasever-my

baseurl=http://192.168.31.114/download/

Gpgcheck=1

Enabled=1

Gpgkey=http://192.168.31.114/download

#192.168.31.114 is the Yum source server IP

Yum Clean All

Yum Makecache

Yum Update

rm-rf/var/yum.repo.d/centos-*

This article is from the "Guo Shaolong" blog, make sure to keep this source http://shaolong.blog.51cto.com/6634276/1910064

HTTP way to build local Yum source server

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.