- 上传两个iso镜像到root用户主目录下
- mkdir /mnt/01 mkdir /mnt/02
- 执行 mount -o loop -t iso9660 /root/CentOS-5.6-x86_64-bin-DVD-1of2.iso /mnt/01 mount -o loop -t iso9660 /root/CentOS-5.6-x86_64-bin-DVD-2of2.iso /mnt/02 cp -r /mnt01/Packages /var/ftp/pub cp -r /mnt02/Packages/* /var/ftp/pub/Packages cp -r /mnt01/repodata /var/ftp/pub
- 修改/etc/yum.repos.d/的配置文件CentOS-Base.repo文件,该目录下的其他配置文件要么删除或者更改位置要么更改名称,目的只使CentOS-Base.repo生效 vi /etc/yum.repos.d/CentOS-Base.repo将内容修改如下: # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=file:///var/ftp/pub gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
- 下面就可以使用yum install mysql或者yum groupinstall chinese-support的方式来安装所需要的功能或者软件了 yum clean all yum list all yum makecache yum install zlib* yum groupinstall
- 如果其他主机也想使用此yum,则先开启此主机vsftp服务,然后修改其他主机的/etc/yum.repos.d/的配置文件CentOS-Base.repo文件,该目录下的其他配置文件要么删除或者更改位置要么更改名称,目的只使CentOS-Base.repo生效。 vi /etc/yum.repos.d/CentOS-Base.repo将内容修改如下: baseurl=ftp://192.168.1.1/pub gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
- 这样其他主机就可以操作 yum clean all yum list all yum makecache yum install zlib* yum groupinstall