How to publish your own software installation and update Yum source
Before we create it, let's take a look at some of the relevant things:
The Yum warehouse can support three ways for yum to download RPM packages when installing
The first type: FTP Service ftp://
The second type: HTTP service
The third type: local file file://
For the moment, we can divide the installation of Yum into the client and server side, and of course your client and server can be a single host
1. First, assume that we apply the name HelloWorld (can refer to the simple RPM package made to create two versions of HelloWorld installation RPM package, helloworld-1.0.0-1.el6.x86_64. RPM and helloworld-1.0.0-2.el6.x86_64.rpm, where the second RPM package is the first upgrade package)
2. Create a Yum repository
- 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. Create a new file on the test machine/etc/yum.repos.d/my.repo, which reads as follows
- [My]
- Name=my
- Baseurl=http://<repos_host>/yum_repos/my/packages
- Enabled=1
- Gpgcheck=0
- Priority=1
Where <repos_host> is the machine name or IP address of the YUM source.
4. Updating the local YUM cache
- sudo yum clean all
- sudo yum Makecache
5. Query HelloWorld Application
- sudo yum list HelloWorld
- sudo yum search HelloWorld
6. Install the App
- sudo yum install HelloWorld
Then run HelloWorld to test
7. Update your App
7.1 First update the RPM package in the YUM repository, copy the helloworld-1.0.0-2.el6.x86_64.rpm to the/var/www/html/yum_repo/my/packages directory, and then delete the old version of the RPM package. Finally, run the following command to update the warehouse
- Cd/var/www/html/yum_repo/my/packages
- sudo createrepo.
7.2 Update HelloWorld on client
- sudo yum clean all
- sudo yum Makecache
- sudo yum update HelloWorld
CentOS Create local Yum repository