{"id":1579,"date":"2011-02-22T17:00:56","date_gmt":"2011-02-23T00:00:56","guid":{"rendered":"http:\/\/gurulog.selfip.net\/?p=1579"},"modified":"2011-02-22T17:00:56","modified_gmt":"2011-02-23T00:00:56","slug":"howto-creating-a-local-repository-for-fedora-12","status":"publish","type":"post","link":"https:\/\/www.evanscomputers.com\/index.php\/2011\/02\/22\/howto-creating-a-local-repository-for-fedora-12\/","title":{"rendered":"Howto: create a local repository for Fedora."},"content":{"rendered":"<p>Creating a local Fedora repository is a great way to conserve bandwidth.  You can update all of the computers on your local network from one repository.<\/p>\n<p>1)\u00a0 Install a web server.\u00a0 I use apache.<br \/>\nsu -c yum install httpd -y<\/p>\n<p>2)\u00a0 Create the directories that become the local repository.<br \/>\nsu -c mkdir -p \/var\/www\/html\/yum\/F15\/releases<br \/>\nsu -c mkdir -p \/var\/www\/html\/yum\/F15\/updates<\/p>\n<p>3) Install the remote synchronization tool rsync.<br \/>\nsu -c yum install rsync -y<\/p>\n<p>4) Use rsync to populate your repository.<br \/>\n\/usr\/bin\/rsync -avrt rsync:\/\/linux.mirrors.es.net\/fedora\/linux\/updates\/15\/x86_64\/ &#8211;exclude=debug\/ \/var\/www\/html\/yum\/F15\/updates<br \/>\n\/usr\/bin\/rsync -avrt rsync:\/\/linux.mirrors.es.net\/fedora\/linux\/releases\/15\/Everything\/x86_64\/os\/Packages\/ \/var\/www\/html\/yum\/F15\/everything<\/p>\n<p>I create a cron job for the rsync process. The following synchronizes daily.<br \/>\nsu -c touch \/etc\/cron.daily\/rsyncfedora15.cron<br \/>\nsu &#8211; gedit \/etc\/cron.daily\/rsyncfedora15.cron<\/p>\n<p>Paste the 3 lines of code below into the rsyncfedora15.cron file.<br \/>\n<code>#!\/bin\/bash<br \/>\n\/usr\/bin\/rsync -avrt rsync:\/\/linux.mirrors.es.net\/fedora\/linux\/updates\/15\/x86_64\/ --exclude=debug\/ \/var\/www\/html\/yum\/F15\/updates &gt;&gt; \/var\/log\/rsync15updates.log<br \/>\n\/usr\/bin\/rsync -avrt rsync:\/\/linux.mirrors.es.net\/fedora\/linux\/releases\/15\/Everything\/x86_64\/os\/Packages\/ \/var\/www\/html\/yum\/F15\/everything &gt;&gt; \/var\/log\/rsync15.log<\/code><\/p>\n<p>Then save the file.<br \/>\nThis also creates and appends two log files rsync15update.log and rsync15.log in the \/var\/log directory.<\/p>\n<p>The first time the repository synchronizes it may take considerable time and bandwidth.\u00a0 Be patient for the process to complete.<\/p>\n<p>If you do NOT plan to make a full mirror of an existing Fedora repository you should use the createrepo tool to create and populate the data files and directories correctly.<br \/>\nsu -c yum install createrepo<\/p>\n<p>Then<br \/>\nsu<br \/>\ncreaterepo -v -p -d &#8211;deltas   \/var\/www\/html\/yum\/F15\/everything<\/p>\n<p>Now you have created the repository for Fedora 15.<\/p>\n<p>Next I create files in my\u00a0 \/etc\/yum.repos.d\/\u00a0 called local.repo and localupdates.repo<\/p>\n<p>local.repo has the following in it:<\/p>\n<p>[local]<br \/>\nname=Fedora $releasever &#8211; $basearch<br \/>\nfailovermethod=priority<br \/>\nbaseurl=http:\/\/192.168.1.100\/yum\/F15\/everything\/i686\/<br \/>\n#mirrorlist=https:\/\/mirrors.fedoraproject.org\/metalink?repo=fedora-$releasever&amp;arch=$basearch<br \/>\nenabled=1<br \/>\nmetadata_expire=7d<br \/>\ngpgcheck=1<br \/>\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-fedora-$basearch<\/p>\n<p>localupdates.repo:<\/p>\n<p>[local-updates]<br \/>\nname=Fedora $releasever &#8211; $basearch &#8211; Updates<br \/>\nfailovermethod=priority<br \/>\nbaseurl=http:\/\/192.168.1.100\/yum\/F14\/updates\/i686\/<br \/>\n#mirrorlist=https:\/\/mirrors.fedoraproject.org\/metalink?repo=updates-released-f$releasever&amp;arch=$basearch<br \/>\nenabled=1<br \/>\ngpgcheck=1<br \/>\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-fedora-$basearch<\/p>\n<p>Then I copy those two files to all of my systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a local Fedora repository is a great way to conserve bandwidth. You can update all of the computers on your local network from one repository. 1)\u00a0 Install a web server.\u00a0 I use apache. su -c yum install httpd -y 2)\u00a0 Create the directories that become the local repository. su -c mkdir -p \/var\/www\/html\/yum\/F15\/releases su&hellip; <a class=\"more-link\" href=\"https:\/\/www.evanscomputers.com\/index.php\/2011\/02\/22\/howto-creating-a-local-repository-for-fedora-12\/\">Continue reading <span class=\"screen-reader-text\">Howto: create a local repository for Fedora.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,8,12],"tags":[76,91,127,156,160],"class_list":["post-1579","post","type-post","status-publish","format-standard","hentry","category-fedora","category-howto-2","category-software","tag-fedora","tag-howto","tag-mirror","tag-repository","tag-rsync","entry"],"_links":{"self":[{"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/posts\/1579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/comments?post=1579"}],"version-history":[{"count":0,"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/posts\/1579\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/media?parent=1579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/categories?post=1579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evanscomputers.com\/index.php\/wp-json\/wp\/v2\/tags?post=1579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}