一.搭建在线yum源的优势
1.架设自己的yum源,节省带宽
2.避免通过网络访问延迟
3.对于有联网限制的服务器
二.搭建步骤
1.安装nginx
yum install nginx -y
修改配置文件
vim /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /rpm;
index index.html index.htm;
autoindex on;
}
/usr/local/nginx/sbin/nginx ##启动nginx
2.搭建国内yum源
(1)备份原始yum源
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 clear all
yum repolist
3.同步网络yum源
(1)创建目录
mkdir /rpm
(2)安装工具包
yum -y install yum-utils
cd /rpm
reposync -r base ##缓存网络源到本地
(3)扫描yum源配置目录
createrepo base/Packages/
至此本地yum源搭建成功
三 . 测试
(1)备份自带yum 源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2)配置yum源
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。