createrepo
Submitted by thomas on Thu, 07/23/2009 - 23:16
Now that all the files are in place, we can run createrepo on our repository to generate the files necessary for yum.
[root@server0 install]# yum -y install createrepo Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package createrepo.noarch 0:0.4.4-2.fc6 set to be updated --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================== Package Arch Version Repository Size ======================================================================================================== Installing: createrepo noarch 0.4.4-2.fc6 Install_Server_Client 37 k Transaction Summary ======================================================================================================== Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 37 k Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : createrepo [1/1] Installed: createrepo.noarch 0:0.4.4-2.fc6 Complete! [root@server0 install]# cd Local [root@server0 Local]# mv comps.xml x86_64 [root@server0 Local]# ln x86_64/comps.xml i386 [root@server0 Local]# createrepo -g comps.xml x86_64 9/9 - augeas-0.5.1-1.el5.x86_64.rpm Saving Primary metadata Saving file lists metadata Saving other metadata [root@server0 Local]# createrepo -g comps.xml i386 5/5 - func-0.24-1.el5.noarch.rpm Saving Primary metadata Saving file lists metadata Saving other metadataNow that our repo files are in place, we need to create an rpm for our repository so we can install it with kickstart or we can install a repo file and add the key to rpm using kickstart. Creating an rpm is probably cleaner. If you want to test this repo at this point, you can add the following file to /etc/yum.repos.d, and copy the RPM-GPG-KEY-example.com that we created earlier into /etc/pki/rpm-gpg (actually, since we already imported the key with rpm --import, yum shouldn't complain about keys at this point, but copying the file is a good idea).
[root@server0 yum.repos.d]# cp ~signer/RPM-GPG-KEY-example.com /etc/pki/rpm-gpg/ [root@server0 yum.repos.d]# cat local.repo [Local] name=Local RPMS $releasever - $basearch baseurl=file:///var/www/html/install/Local/$basearch gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example.com enabled=1 [root@server0 yum.repos.d]# yum search augeas Local | 1.1 kB 00:00 primary.xml.gz | 2.8 kB 00:00 Local 7/7 =========================================== Matched: augeas ============================================ augeas.x86_64 : A library for changing configuration files augeas-libs.x86_64 : Libraries for augeas ruby-augeas.x86_64 : Ruby bindings for Augeas [root@server0 yum.repos.d]# yum grouplist |grep Client Local Client
