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