This article takes the self-built Guestfish image management tool source as an example:
The first step: empty the local Yum cache to avoid confusion with previously downloaded packages;
#yum Clean All
Step two: Yum downloads the required packages.
Note: There are two ways to cache RPM packages:
Method one: The download command directly restricts the download not to install, this is the downloaded RPM package will not be installed.
#yum-y install libguestfs-tools --downloadonly
#yum-y install libguestfs-winsupport --downloadonly
Method Two: You can modify the/etc/yum.conf configuration file to open the cache, so that both the installation can be downloaded and cache rpm package.
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/96/44/wKiom1ket6ag9jvFAAAg0GvjOdw889.png-wh_500x0-wm_ 3-wmp_4-s_359242667.png "title=" 2017-05-19 17-14-38 screen. png "alt=" wkiom1ket6ag9jvfaaag0gvjodw889.png-wh_50 "/>
Once you have modified the configuration file, you only need to download the installation package. The RPM packet is cached under the package under the download source under var/cache/yum/$basearch/$releasever.
#yum-y Install Libguestfs-tools
#yum-y install libguestfs-winsupport
Step three: Locate the cached RPM package, copy the RPM package to the Guestfish directory, and create the Yum repository.
#mkdir/var/ftp/guestfish
#find/var/cache/yum/-iname "*.rpm"
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/96/44/wKiom1ketsHCFPUjAAB7hF7DfEA600.png-wh_500x0-wm_ 3-wmp_4-s_3444315290.png "title=" 2017-05-19 17-10-48 screen. png "alt=" wkiom1ketshcfpujaab7hf7dfea600.png-wh_50 "/>
#find/var/cache/yum/-iname "*.rpm"-exec cp-r {}/var/ftp/guestfish/
#createrepo/var/ftp/guestfish
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/96/44/wKiom1kethqDofVUAABC0Zb7pYo102.png-wh_500x0-wm_ 3-wmp_4-s_2655158347.png "title=" 2017-05-19 17-07-17 screen. png "alt=" wkiom1kethqdofvuaabc0zb7pyo102.png-wh_50 "/>
To this guestfish the Yum Warehouse is built.
This article is from "Mr. Rabbit" blog, please be sure to keep this source http://12773668.blog.51cto.com/12763668/1927637
Linux self-built yum source repository