- 论坛徽章:
- 0
|
问题:搭建一台局域网的CentOS的基于http服务的yum服务器,用于局域网的CentOS更新用。
现在的情况:有CentOS-5.5-i386-bin-DVD镜像一个,服务器可以上外网。其它的CentOS机子均不可。
搭建环境:VMware workstation server的IP:192.168.36.133
【准备工作】
CentOS_Server所需安装的软件包:
yum-3.2.19-18.el5.centos (默认已安装)
yum-metadata-parser-1.1.2-2.el5 (默认已安装)
yum-fastestmirror-1.1.16-13.el5.centos (默认已安装)
yum-updatesd-0.9-2.el5 (默认已安装)
createrepo-0.4.11-3.el5 未安装
yum-arch-2.2.2-2.el5.kb.noarch.rpm (此包需要去网站下载例如http://rpm.pbone.net/) 未安装
httpd-2.2.3-22.el5.centos (默认已安装)
----说明:所有套件的版本号可能不同,但是都是来自DVD包的。
CentOS_Client所需安装的软件包:
yum-3.2.19-18.el5.centos
yum-metadata-parser-1.1.2-2.el5
【yum server搭建】
(1)建立放置RPM的位置
# mkdir -p /var/www/html/yum/centos/5.5/os/i386
# mkdir -p /var/www/html/yum/centos/5.5/updates/i386
----目前只建立这两个,还有其它的等这两个实验成功后再加入。
(2)针对目前的yum server 来更新套件 (用上海交大的ftp)
# mirrordir -v http://ftp.sjtu.edu.cn/centos/5.5/os/i386/ /var/www/html/yum/centos/5.5/os/i386
# mirrordir -v http://ftp.sjtu.edu.cn/centos/5.5/updates/i386 /var/www/html/yum/centos/5.5/updates/i386
--但是很不幸的是报错:
mirrordir: unable to open directory: /root/http:/ftp.sjtu.edu.cn/centos/5.5/updates: No such file or directory
这到底是为什么啊??
没有办法,我只有先把updates里的文件下下来再自己放进去。
(3)分析RPM 产生headers资料夹
# yum-arch /var/www/html/yum/centos/5.5/os/i386
# yum-arch /var/www/html/yum/centos/5.5/updates/i386
(4)createrepo 产生 XML metadata,在目录下产生 repodata 文件夹
# createrepo /var/www/html/yum/centos/5.5/os/i386
# createrepo /var/www/html/yum/centos/5.5/updates/i386
【client 设定】
# cd /etc/yum.repos.d
# cp CentOS-Base.repo CentOS-Base.repo.old
# vim CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://192.168.36.133/yum/centos/5.5/os/i386
gpgcheck=1
gpgkey=http://192.168.36.133/yum/centos/5.5/os/i386/RPM-GPG-KEY-centos5
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://192.168.36.133/yum/centos/5.5/updates/i386
gpgcheck=1
gpgkey=http://192.168.36.133/yum/centos/5.5/updates/i386/RPM-GPG-KEY-centos5
但是最后我用yum list updates时 ,老是有错,
[root@localhost ~]# yum list updates
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* updates: mirrors.163.com
http://192.168.36.133/yum/centos/5.5/os/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (113, '\xe6\xb2\xa1\xe6\x9c\x89\xe5\x88\xb0\xe4\xb8\xbb\xe6\x9c\xba\xe7\x9a\x84\xe8\xb7\xaf\xe7\x94\xb1')>
Trying other mirror.
http://192.168.36.133/yum/centos/5.5/updates/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (113, '\xe6\xb2\xa1\xe6\x9c\x89\xe5\x88\xb0\xe4\xb8\xbb\xe6\x9c\xba\xe7\x9a\x84\xe8\xb7\xaf\xe7\x94\xb1')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: update. Please verify its path and try again
请大家帮帮忙吧。我已经搭了很久了。 |
|