yum源

今天说说怎样发布自己软件的安装和更新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/Packages
sudo 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=my
baseurl=http://<repos_host>/yum_repos/my/Packages
enabled=1
gpgcheck=0
priority=1
其中 <repos_host> 是 YUM 源的机器名或IP地址。

4. 更新本地 YUM 缓存

sudo yum clean all
sudo yum makecache
5. 查询helloworld应用

sudo yum list helloworld
sudo yum search helloworld
6. 安装应用

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/Packages
sudo createrepo .

7.2 在客户端更新 helloworld


sudo yum clean all
sudo yum makecache
sudo 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

linux

原文地址:https://www.cnblogs.com/quxiuke/p/6129952.html