yum源

mac2022-06-30  23

今天说说怎样发布自己软件的安装和更新YUM源

1. 首先,假定我们应用的名字叫helloworld(可以参考简单 RPM 包制作来创建两个版本helloworld安装RPM包,helloworld-1.0.0-1.el6.x86_64.rpm和helloworld-1.0.0-2.el6.x86_64.rpm,其中第二个rpm包是第一个的升级包)

2. 创建YUM仓库

sudo mkdir -p /var/www/html/yum_repo/my/Packagessudo cp helloworld-1.0.0-1.el6.x86_64.rpm /var/www/html/yum_repo/my/Packages/;cd /var/www/html/yum_repo/my/Packages; sudo createrepo .sudo /etc/init.d/httpd start

3. 在测试机器上创建新文件/etc/yum.repos.d/my.repo,内容如下

[my]name=mybaseurl=http://<repos_host>/yum_repos/my/Packagesenabled=1gpgcheck=0priority=1其中 <repos_host> 是 YUM 源的机器名或IP地址。

4. 更新本地 YUM 缓存

sudo yum clean allsudo yum makecache5. 查询helloworld应用

sudo yum list helloworldsudo yum search helloworld6. 安装应用

sudo yum install helloworld然后运行 helloworld 来测试

7. 更新应用

7.1 首先更新 YUM 仓库中的 RPM 包,将 helloworld-1.0.0-2.el6.x86_64.rpm 复制到 /var/www/html/yum_repo/my/Packages 目录下,然后将旧版本的rpm包删除。最后运行下面的命令来更新仓库

cd /var/www/html/yum_repo/my/Packagessudo createrepo .

7.2 在客户端更新 helloworld

sudo yum clean allsudo yum makecachesudo yum update helloworld

CentOS中将DVD作为默认yum源的设置方法  http://www.linuxidc.com/Linux/2015-01/111266.htm

RedHat 6.2 Linux修改yum源免费使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm

配置EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm

Redhat 本地yum源配置 http://www.linuxidc.com/Linux/2012-11/75127.htm

yum的配置文件说明 http://www.linuxidc.com/Linux/2013-04/83298.htm

RedHat 6.1下安装yum(图文) http://www.linuxidc.com/Linux/2013-06/86535.htm

YUM 安装及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm

CentOS 6.4上搭建yum本地源 http://www.linuxidc.com/Linux/2014-07/104533.htm

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-02/113897.htm

转载于:https://www.cnblogs.com/quxiuke/p/6129952.html

最新回复(0)