如何将rpm软件包发布到YUM [英] How to publish a rpm package to YUM

查看:190
本文介绍了如何将rpm软件包发布到YUM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个rpm软件包,我需要将其发布到YUM,以便用户可以直接执行yum install softwareName来安装该应用程序.我在Google上进行了搜索,但找不到很多资源.我是这个东西的新手,所以我真的不知道我想做什么.我尝试为该应用程序创建本地yum存储库,但它似乎仅适用于本地计算机.有人可以帮忙吗?谢谢.

I have created a rpm package, and I need to publish it to YUM so that users can directly do yum install softwareName to install the application. I searched on google but can't find many resources. I'm new to this thing so I don't really know what I want to do is possible. I've tried to create a local yum repository for the application, but it seems work only for the local machine. Can anyone help please? Thank you.

推荐答案

假定您已将YUM安装在Linux机器上.

Assuming you've YUM installed on a Linux box.

您需要创建一个包含RPM的YUM存储库.例如,

You need to create a YUM repository that contains your RPM. For example,

./mydir/Packages/my.rpm

使用 createrepo 为该目录创建存储库.

Use createrepo to create repository for that directory.

createrepo ./mydir

上面将在 ./mydir

然后通过在/etc/yum.repos.d/my.repo 中创建一个回购文件来告诉YUM该存储库在哪里. my.repo 的内容可以是这样的:

Then tell YUM where that repository is by creating a repo file in /etc/yum.repos.d/my.repo. Contents of my.repo can be something like this:

[my_repo]
name=My YUM REPO
baseurl=file:///path/to/mydir
enabled=1

然后做 yum --enablerepo = *全部清除.这应该重新生成yum的元数据.

Then do, yum --enablerepo=* clean all. This should regenerate metadata for yum.

最后,

`yum --enablerepo=* install my`

以上, my 指的是 my.rpm

要从网络上的其他计算机访问此文件,您需要进行Web访问,

In order to access this from other machines on the network, you need a web access,

安装 http .将您的存储库放置在/var/www/html/repos/mydir/Packages/my.rpm

Install http. Place your repository somewhere in, /var/www/html/repos/mydir/Packages/my.rpm

然后按照其他步骤操作,并编辑 my.repo 文件,以将计算机的 hostname 包含在 baseurl 属性中:

Then follow other steps and edit my.repo file to include hostname of the machine in the baseurl attribute :

 baseurl=http://myrepository.com/mydir

这篇关于如何将rpm软件包发布到YUM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆