CentOS制作局域网yum源

1.安装vsftpd服务,修改配置,允许匿名访问

[root@localhost home]# vi /etc/vsftpd/vsftpd.conf 
anonymous_enable=YES
[root@localhost home]# service vsftpd restart 

2.拷贝镜像文件至服务器,并挂载至一个分区

[root@localhost home]# mkdir -p /mnt/centos65
[root@localhost home]# mount -o loop /home/CentOS-6.5-x86_64-bin-DVD1.iso /mnt/centos65/

3.将镜像内文件拷贝至ftp目录

[root@localhost home]# mkdir -p /var/ftp/centos65/
[root@localhost home]# cp -rf /mnt/centos65/* /var/ftp/centos65/

4.浏览器访问ftp目录

如果无法访问可能是服务器防火墙打开了,请关闭

[root@localhost home]# service iptables stop

 

5.修改客户端服务器yum配置

在此之前可以先将yum配置文件备份或删除

[root@localhost home]# more /etc/yum.repos.d/CentOS-Base.repo 
[base]
name=CentOS-$releasever-Base
baseurl=ftp://192.168.229.128/centos65
gpgcheck=1
gpgkey=http://192.168.229.128/centos65/RPM-GPG-KEY-CentOS-6

6.OK , show it !

[root@localhost home]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost home]# 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:00     
base/primary_db                                        | 4.4 MB     00:00     
base/other_db                                          | 2.7 MB     00:00     
Metadata Cache Created
[root@localhost home]# yum list

 

posted @ 2020-03-15 22:00  alianblog  阅读(693)  评论(0编辑  收藏  举报