一,建立一个yum仓库,建立服务端
1,建立一个目录/export/yum/Server
2, 拷贝rpm到这个目录
3,安装createrepo
[root@localhost Server]# rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm
warning: createrepo-0.4.4-2.fc6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@localhost yum]#
4,执行:
[root@localhost Server]# createrepo -v /export/yum/Server
1/2158 - libbtctl-0.6.0-9.2.el5.i386.rpm
2/2158 - man-pages-cs-0.16-6.noarch.rpm
5,配置一下httpd服务
做链接文件:
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ln -s /export/ ./
重新启动httpd服务
[root@localhost html]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@localhost html]#
6,客户端清除yum缓存信息:
[root@localhost ~]# yum clean dbcache
Loading "security" plugin
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
0 cache files removed
[root@localhost ~]#
二,建立yum客户端配置文件
create a file in /etc/yum.repos.d for your repository
文件内容:
[tonykorn97]
name=tonykorn97 yum server
baseure=http://172.25.1.141/export/yum/Server
enabled=1
gpgcheck=0
更新的时候提示:
[root@localhost yum.repos.d]# yum list httpd
Loading "security" plugin
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
Error: Cannot find a valid baseurl for repo: tonykorn97
[root@localhost yum.repos.d]#
更改为就内容为:
[tonykorn97]
name=tonykorn97 yum server
baseure=file:///export/yum/Server
enabled=1
gpgcheck=0
一样的结果。
发现是baseurl写错成baseure了,更改过来后就可以了。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/312079/viewspace-245852/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/312079/viewspace-245852/