2022-10-30 397
简单写一写,用作仓库的虚拟机IP为192.168.149.129。我计划将/usr/local/src这个目录下的软件当做YUM源。首先确保http服务正常。
1、我用的是apache,默认根目录是/var/www/html,所以在这个目录下做了一个软链接:
[root@bogon html]# ln -s /usr/local/src .
[root@bogon html]# ll
total 3
lrwxrwxrwx 1 root root 14 Nov 2 11:13 src -> /usr/local/src
2、使用createrepo命令格式化仓库:
[root@bogon src]# createrepo .
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@bogon src]# ls
repodata
[root@bogon src]# cd repodata/
[root@bogon repodata]# ls
01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2 6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz repomd.xml
401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz 7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2
5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2 dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz
3、将rpm包放在src目录下,更新一下,在客户端应该就能看到这个包了:
[root@bogon src]# createrepo --update .
Spawning worker 0 with 1 pkgs
Spawning worker 1 with 0 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
4、验证,在客户端/etc/yum.repos.d下创建一个以.repo结尾的文件:
[root@localhost yum.repos.d]# cat test.repo
[TestYum]
name=TestYum
baseurl=http://192.168.149.129/src
gpgcheck=0
enabled=1
5、运行yum clean all && yum repolist,嗯,确实有1个包,完成。
总结
以上所述是小编给大家介绍的自制YUM仓库的步骤讲解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持! 如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
原文链接:https://77isp.com/post/5328.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态