IP地址规划:
1) YUM服务器—192.168.1.11
2) YUM客户端—192.168.1.12
一、配置服务器
安装vsftp
mount /dev/cdrom /mnt
cd /mnt/CentOS
rpm -ivh vsftpd*
mkdir -p /var/ftp/yumservers/centos
cp -vrf /mnt/CentOS/* /var/ftp/yumservers/centos
cp -vrf /mnt/repodata /var/ftp/yumservers/
2.安装createrepo (创建yum库)
cd /var/ftp/yumservers/centos
rpm -ivh create*
createrepo -g /var/ftp/yumservers/repodata/repomd.xml /var/ftp/yumservers/centos/
3.启动vsftpd与关闭防火墙
service vsftpd start
service iptables stop
二、配置客户端
vim /etc/yum.repos.d/iso.repo
[c5-media]
name=CentOS
baseurl=ftp://192.168.1.11/yumservers/centos/
gpgcheck=0
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
mv CentOS-Base.repo CentOS-Base.repo.bak
时间: 2024-11-05 11:30:21