- 论坛徽章:
- 0
|
=========================================================== \r\n作者: tonykorn97(http://tonykorn97.itpub.net)\r\n发表于: 2008.04.05 22:51\r\n分类: linux \r\n出处: http://tonykorn97.itpub.net/post/6414/459075\r\n--------------------------------------------------------------- \r\n\r\n一,建立一个yum仓库,建立服务端\r\n\r\n1,建立一个目录/export/yum/Server\r\n2, 拷贝rpm到这个目录\r\n\r\n\r\n\r\n\r\n3,安装createrepo\r\n[root@localhost Server]# rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm \r\nwarning: createrepo-0.4.4-2.fc6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186\r\nPreparing... ########################################### [100%]\r\n1:createrepo ########################################### [100%]\r\n[root@localhost yum]# \r\n\r\n4,执行:\r\n[root@localhost Server]# createrepo -v /export/yum/Server\r\n1/2158 - libbtctl-0.6.0-9.2.el5.i386.rpm\r\n2/2158 - man-pages-cs-0.16-6.noarch.rpm\r\n\r\n5,配置一下httpd服务\r\n做链接文件:\r\n[root@localhost html]# pwd\r\n/var/www/html\r\n[root@localhost html]# ln -s /export/ ./\r\n\r\n重新启动httpd服务\r\n[root@localhost html]# service httpd restart\r\nStopping httpd: [ OK ]\r\nStarting httpd: [ OK ]\r\n[root@localhost html]#\r\n\r\n6,客户端清除yum缓存信息:\r\n[root@localhost ~]# yum clean dbcache\r\nLoading \"security\" plugin\r\nLoading \"rhnplugin\" plugin\r\nLoading \"installonlyn\" plugin\r\nThis system is not registered with RHN.\r\nRHN support will be disabled.\r\n0 cache files removed\r\n[root@localhost ~]# \r\n\r\n\r\n二,建立yum客户端配置文件\r\ncreate a file in /etc/yum.repos.d for your repository\r\n文件内容:\r\n[tonykorn97]\r\nname=tonykorn97 yum server\r\nbaseure=http://172.25.1.141/export/yum/Server\r\nenabled=1\r\ngpgcheck=0\r\n\r\n更新的时候提示:\r\n[root@localhost yum.repos.d]# yum list httpd\r\nLoading \"security\" plugin\r\nLoading \"rhnplugin\" plugin\r\nLoading \"installonlyn\" plugin\r\nThis system is not registered with RHN.\r\nRHN support will be disabled.\r\nSetting up repositories\r\nError: Cannot find a valid baseurl for repo: tonykorn97\r\n[root@localhost yum.repos.d]# \r\n\r\n更改为就内容为:\r\n[tonykorn97]\r\nname=tonykorn97 yum server\r\nbaseure=file:///export/yum/Server\r\nenabled=1\r\ngpgcheck=0\r\n\r\n一样的结果。\r\n\r\n发现是baseurl写错成baseure了,更改过来后就可以了。 |
|