码迷,mamicode.com
首页 > 其他好文 > 详细

虚拟机无法访问外网如何搭建yum源

时间:2017-07-18 21:05:28      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:yum   源搭建   

1.挂载磁盘:

[root@web1 ~]# cat /etc/fstab  | tail -1

/dev/cdrom /mnt iso9660 loop,defaults 0 0

[root@web1 ~]# mount –a

[root@web1 ~]# df -h | tail -1

/dev/sr0                      4.2G  4.2G    0 100% /mnt

2.搭建:

[root@web1 ~]# cat/etc/yum.repos.d/CentOS-6.repo

[local-yum]

name=CentOS-loal

baseurl=file:///mnt

gpgcheck=0

enabled=1

[root@web1 ~]# yum clean all

[root@web1 ~]# yum repolist


本文出自 “一叶剑客” 博客,谢绝转载!

虚拟机无法访问外网如何搭建yum源

标签:yum   源搭建   

原文地址:http://jfqyy.blog.51cto.com/10833048/1948658

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