码迷,mamicode.com
首页 > 系统相关 > 详细

linux 系统本地yum源配置

时间:2016-08-03 15:49:22      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:yum源

#############creat local yumsource##############

mkdir /westos                                         ##建立目录/westos

mount /iso/rhel-server-7.1-x86_64-dvd.iso /westos     ##将镜像文件挂载到/westos      

mkdir /backup                                         ##建立目录/backup

mv /etc/yum.repos.d/* /backup                         ##/etc下的干扰文件移动到/backup

 

cat > /etc/yum.repos.d/yum.repo <<end                 ##编辑仓库文件

[test]

name=test

baseurl=file:///westos

gpgcheck=0

end

 

yum clean all                                            ##刷新仓库配置

 

##############install shareserver#####################

yum install httpd -y                                 ##安装httpd

systemctl start httpd                                #启动httpd

systemctl enable httpd                               ##开机启动httpd

systemctl stop firewalld                             ##关闭防火墙

systemctl disable firewalld                          ##开机不启动防火墙


 

################mount iso to sharedirectory#############

umount /westos                                     ##取消镜像文件挂载

mkdir /var/www/html/rhel7.1                        ##/var/www/html中建立目录/rhel7.1

mount/iso/rhel-server-7.1-x86_64-dvd.iso /var/www/html/rhel7.1        ##将镜像文件挂载到/rhel7.1

 

echo"/iso/rhel-server-7.1-x86_64-dvd.iso /var/www/html/rhel7.1 iso9660 ro 0 0" >> /etc/fstab

                                                                      ##将临时挂载改为永久挂载

 

##################cofig localyum######################            

cat > /etc/yum.repos.d/yum.repo <<end                       ##重新编辑文件/yum.repo

[test]

name=test

baseurl=file:///var/www/html/rhel7.1

#baseurl=http://172.25.38.250/rhel7.1

gpgcheck=0

end

 

浏览器中输入http://172.25.38.250/rhel7.1查看yum源是否配置成功

 


本文出自 “11904005” 博客,转载请与作者联系!

linux 系统本地yum源配置

标签:yum源

原文地址:http://11914005.blog.51cto.com/11904005/1833745

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!