今天说说怎样发布自己软件的安装和更新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 start3. 在测试机器上创建新文件/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 helloworldCentOS中将DVD作为默认yum源的设置方法 http://www.linuxidc.com/Linux/2015-01/111266.htmRedHat 6.2 Linux修改yum源免费使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm配置EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htmRedhat 本地yum源配置 http://www.linuxidc.com/Linux/2012-11/75127.htmyum的配置文件说明 http://www.linuxidc.com/Linux/2013-04/83298.htmRedHat 6.1下安装yum(图文) http://www.linuxidc.com/Linux/2013-06/86535.htmYUM 安装及清理 http://www.linuxidc.com/Linux/2013-07/87163.htmCentOS 6.4上搭建yum本地源 http://www.linuxidc.com/Linux/2014-07/104533.htm本文永久更新链接地址