配置环境:
系统版本:
[[email protected] ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
Kernel \r on an \m
系统32位:
[[email protected] ~]# getconf LONG_BIT
32
YUM源服务器,IP:192.168.2.1
YUM客户端,IP:192.168.2.2
一、配置本地YUM源服务器:
挂在光盘:
[[email protected] ~]# mkdir /var/ftp/rhel5
[[email protected] ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected,mounting read-only
将光盘中所有的文件复制到本地/var/ftp/rhel5
[[email protected] ~]# cp -rf /media/* /var/ftp/rhel5/
查看复制内容大小:
[[email protected] ~]# du -sh /var/ftp/rhel5/
3.3G /var/ftp/rhel5/
安装vsftp服务:
[[email protected] Server]# rpm -ivhvsftpd-2.0.5-24.el5.i386.rpm
warning: vsftpd-2.0.5-24.el5.i386.rpm: Header V3 DSAsignature: NOKEY, key ID 37017186
Preparing... ############################################[100%]
1:vsftpd ############################################[100%]
启动vsftp服务
[[email protected] ~]# service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
重启vsftp服务
[[email protected] ~]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
安装createrepo插件:
[[email protected] Server]# rpm -ivhcreaterepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3DSA signature: NOKEY, key ID 37017186
Preparing... ###########################################[100%]
1:createrepo ###########################################[100%]
[[email protected]]# createrepo –v /va/ftp/rhel5
[[email protected]]# createrepo –g /var/ftp/rhel5/Server/repodata//var/ftp/rhel5/Server/
[[email protected]]# createrepo –g /var/ftp/rhel5/VT/repodata/comps-rhel5-vt.xml/var/ftp/rhel5/VT/
二、配置YUM客户端
[[email protected] ~]# vi /etc/yum.repos.d/rhel5.repo
[rhel5]
name=RHEL5.8x32
baseurl=ftp://121.52.215.30/rhel5
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release