配置环境:
系统版本:
[root@localhost ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
Kernel \r on an \m
系统32位:
[root@localhost ~]# getconf LONG_BIT
32
YUM源服务器,IP:192.168.2.1
YUM客户端,IP:192.168.2.2
一、配置本地YUM源服务器:
挂在光盘:
[root@localhost ~]# mkdir /var/ftp/rhel5
[root@localhost ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected,mounting read-only
将光盘中所有的文件复制到本地/var/ftp/rhel5
[root@localhost ~]# cp -rf /media/* /var/ftp/rhel5/
查看复制内容大小:
[root@localhost ~]# du -sh /var/ftp/rhel5/
3.3G /var/ftp/rhel5/
安装vsftp服务:
[root@localhost 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服务
[root@localhost ~]# service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
重启vsftp服务
[root@localhost ~]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
安装createrepo插件:
[root@localhost 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%]
[root@localhost]# createrepo –v /va/ftp/rhel5
[root@localhost]# createrepo –g /var/ftp/rhel5/Server/repodata//var/ftp/rhel5/Server/
[root@localhost]# createrepo –g /var/ftp/rhel5/VT/repodata/comps-rhel5-vt.xml/var/ftp/rhel5/VT/
二、配置YUM客户端
[root@localhost ~]# 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
本文出自 “I want to be with you” 博客,转载请与作者联系!
原文地址:http://songxun.blog.51cto.com/5902716/1659600