服务端配置
创建挂载目录
mkdir /media/CentOS_6.5_Final
赋予挂载目录权限
chmod -R 777 /media/CentOS_6.5_Final
挂载iso
mount -o loop CentOS-6.5-x86_64-bin-DVD1.iso /media/CentOS_6.5_Final/
常规挂载
mount /dev/cdrom /media/CentOS_6.5_Final/
安装vsftpd
cd /media/CentOS_6.5_Final/
rpm -ivh vsftpd-2.2.2-11.el6_4.1.x86_64.rpm
拷贝数据
cp -rf /media/CentOS_6.5_Final/* /var/ftp/pub
安装createrepo以及依赖工具
cd /var/ftp/pub/Packages
rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh createrepo-0.9.9-18.el6.noarch.rpm
createrepo /var/ftp/pub/repodata
绕过从互联网安装
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repose_bak
mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo_bak
mv CentOS-Media.repo CentOS-Media.repo_bak
配置只从本地安装
vi CentOS-Media.repo
[xby-01]
name=Centos-xby
baseurl=file:///var/ftp/pub/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
清除缓存
yum clean all
生成缓存
yum makecache
测试
yum -y install lrzsz
重启vsftpd 服务
service vsftpd restart
开机启动
chkconfig vsftpd on
客户端配置
cd /etc/yum.repos.d/
绕过从互联网安装
mv CentOS-Base.repo CentOS-Base.repose_bak
mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo_bak
mv CentOS-Media.repo CentOS-Media.repo_bak
配置只从本地安装
vi CentOS-Media.repo
[xby0]
name=xby
baseurl=ftp://192.168.1.8/pub/
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.1.8/pub/RPM-GPG-KEY-CentOS-6
清除缓存
yum clean all
生成缓存
yum makecache
测试
yum -y install lrzsz
原文链接:https://www.f2er.com/centos/375521.html