Win7制作局域网yum源
CentOS安装rpm包简直就是. . .,各种相互依赖,而生产环境基本都是内网,无法连接网络,因此制作一个内网可访问yum源将简化日常的工作。以下是win7 PC机搭建yum源:
准备工作
1.镜像文件,以CentOS6.5为例CentOS-6.5-x86_64-bin-DVD1.iso,使用【好压】解压后,将Packages、repodata、RPM-GPG-KEY-CentOS-6拷贝至新文件夹
2.在win7 PC机下载安装hfs.exe,作为web服务器
3.选中左侧栏根目录,点击右键添加第一步拷贝的文件夹www,选择【Real folder】
至此,yum源已搭建OK,so easy !
5.修改服务器yum源配置
将/etc/yum.repos.d/目录下文件全部mv至其他目录备份或删除,重新生成文件/etc/yum.repos.d/CentOS-Base.repo
[root@localhost local]# more /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-$releasever-Base baseurl=http://192.168.0.103/www gpgcheck=1 gpgkey=http://192.168.0.103/www/RPM-GPG-KEY-CentOS-6
6.测试成功
[root@localhost local]# yum clean all Loaded plugins: fastestmirror, refresh-packagekit, security Cleaning repos: base Cleaning up Everything Cleaning up list of fastest mirrors [root@localhost local]# yum makecache Loaded plugins: fastestmirror, refresh-packagekit, security Determining fastest mirrors base | 4.0 kB 00:00 base/group_gz | 220 kB 00:00 base/filelists_db | 5.8 MB 00:03 base/primary_db | 4.4 MB 00:02 base/other_db | 2.7 MB 00:01 Metadata Cache Created [root@localhost local]# yum list