{"id":5333,"date":"2013-07-10T19:37:43","date_gmt":"2013-07-10T11:37:43","guid":{"rendered":"http:\/\/jpuyy.com\/?p=5333"},"modified":"2013-07-13T18:19:00","modified_gmt":"2013-07-13T10:19:00","slug":"build-a-yum-repo","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=5333","title":{"rendered":"\u5efa\u7acb\u4e00\u4e2ayum\u6e90"},"content":{"rendered":"<p>\u4f7f\u7528\u7684\u5de5\u5177\u662fcreaterepo<\/p>\n<p>\u9996\u5148\u521b\u5efa\u76ee\u5f55\uff0c<\/p>\n<pre>mkdir -p mirrors.jpuyy.com\/centos\/6.4\/os\/x86_64<\/pre>\n<p>\u5e76\u8fdb\u5165\u5230\u6b64\u76ee\u5f55\uff0c\u6267\u884c<\/p>\n<pre>createrepo .<\/pre>\n<p>\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e86repodata\u76ee\u5f55\uff0c\u8bb0\u5f55\u4e86repo\u7684\u4fe1\u606f\u3002<br \/>\n\u6700\u7ec8\u7684rpm\u5305\u90fd\u8981\u653e\u5230Packages\u4e0b<\/p>\n<p>\u76ee\u5f55\u7ed3\u6784\u53c2\u8003http:\/\/mirrors.sohu.com\u3002centos6\u7684\u76ee\u5f55\u8f6f\u94fe\u63a5\u5230centos6.4<\/p>\n<pre>mirrors.jpuyy.com\r\n\u2514\u2500\u2500 centos\r\n    \u251c\u2500\u2500 6 -&gt; 6.4\r\n    \u251c\u2500\u2500 6.0\r\n    \u2514\u2500\u2500 6.4\r\n        \u251c\u2500\u2500 centosplus\r\n        \u251c\u2500\u2500 contrib\r\n        \u251c\u2500\u2500 cr\r\n        \u251c\u2500\u2500 extras\r\n        \u251c\u2500\u2500 fasttrack\r\n        \u251c\u2500\u2500 isos\r\n        \u251c\u2500\u2500 os\r\n        \u2502\u00a0\u00a0 \u2514\u2500\u2500 x86_64\r\n        \u2502\u00a0\u00a0     \u251c\u2500\u2500 EFI\r\n        \u2502\u00a0\u00a0     \u251c\u2500\u2500 images\r\n        \u2502\u00a0\u00a0     \u251c\u2500\u2500 isolinux\r\n        \u2502\u00a0\u00a0     \u251c\u2500\u2500 Packages\r\n        \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u251c\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-client.rpm\r\n        \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u251c\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-common.rpm\r\n        \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u251c\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-devel.rpm\r\n        \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u251c\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-server.rpm\r\n        \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u251c\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-shared.rpm\r\n        \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u2514\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-test.rpm\r\n        \u2502\u00a0\u00a0     \u2514\u2500\u2500 repodata\r\n        \u2502\u00a0\u00a0         \u251c\u2500\u2500 0c2ce006b4ccb96b4d0947584daab68e971f25f0c59a2f856895a3dcc4760e0b-primary.xml.gz\r\n        \u2502\u00a0\u00a0         \u251c\u2500\u2500 2a827a63089cb7561b755baff2c1ae4c202cd74a1a92e1274e85f9e4dac569a0-other.sqlite.bz2\r\n        \u2502\u00a0\u00a0         \u251c\u2500\u2500 3e5e63e57c07f479edc526404f28c63c1ad097670cde380d3866b63090d6f3e0-filelists.xml.gz\r\n        \u2502\u00a0\u00a0         \u251c\u2500\u2500 44a30e7cd6fd27e8f820ba7a50d329c99428ea68b4f0904475c5ee8961c1c8ec-primary.sqlite.bz2\r\n        \u2502\u00a0\u00a0         \u251c\u2500\u2500 b3d59bc4f2a6c3c198798e188b4a0d0af99692efaa88f989c47df4c036fea210-filelists.sqlite.bz2\r\n        \u2502\u00a0\u00a0         \u251c\u2500\u2500 f94e27df58d67783e29dd0aeca51ff7ffec2bc501e0f82e0a4c7d843dcb2cb6c-other.xml.gz\r\n        \u2502\u00a0\u00a0         \u2514\u2500\u2500 repomd.xml\r\n        \u251c\u2500\u2500 updates\r\n        \u2514\u2500\u2500 xen4<\/pre>\n<p>\u8fd9\u91cc\u7684repo\u4f7f\u7528http\u63d0\u4f9b\u670d\u52a1\uff0c\u6240\u4ee5\u5728nginx\u4e0b\uff0c\u5982\u679c\u8981\u9177\u4e00\u4e9b\u7684\u9875\u9762\uff0c\u53ef\u4ee5\u7f16\u8bd1nginx\uff0c\u6dfb\u52a0fancyindex\u6a21\u5757\uff0c<a href=\"http:\/\/wiki.nginx.org\/NginxNgxFancyIndex\">http:\/\/wiki.nginx.org\/NginxNgxFancyIndex<\/a><\/p>\n<pre>server {\r\n    listen 80;\r\n    server_name mirrors.jpuyy.com;\r\n    location \/ {\r\n        root \/data\/mirrors.jpuyy.com\/;\r\n        autoindex on;\r\n    }\r\n}<\/pre>\n<p>\u5728\u9700\u8981\u4f7f\u7528\u6b64\u6e90\u670d\u52a1\u5668\u4e0a\uff0c\u6dfb\u52a0\/etc\/yum.repos.d\/jpuyy-mirrors.repo\uff0c\u5199\u5165<\/p>\n<pre>[mirror-of-jpuyy]\r\nname=mirror-of-jpuyy\r\nbaseurl=http:\/\/mirrors.jpuyy.com\/centos\/$releasever\/os\/$basearch\/\r\nenabled=1\r\ngpgcheck=0<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u7684\u5de5\u5177\u662fcreaterepo \u9996\u5148\u521b\u5efa\u76ee\u5f55\uff0c mkdir -p mirrors.jpuyy.com\/centos\/6.4\/os\/x86_64 \u5e76\u8fdb\u5165\u5230\u6b64\u76ee\u5f55\uff0c\u6267\u884c createrepo . \u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e86repodata\u76ee\u5f55\uff0c\u8bb0\u5f55\u4e86repo\u7684\u4fe1\u606f\u3002 \u6700\u7ec8\u7684rpm\u5305\u90fd\u8981\u653e\u5230Packages\u4e0b \u76ee\u5f55\u7ed3\u6784\u53c2\u8003http:\/\/mirrors.sohu.com\u3002centos6\u7684\u76ee\u5f55\u8f6f\u94fe\u63a5\u5230centos6.4 mirrors.jpuyy.com \u2514\u2500\u2500 centos \u251c\u2500\u2500 6 -&gt; 6.4 \u251c\u2500\u2500 6.0 \u2514\u2500\u2500 6.4 \u251c\u2500\u2500 centosplus \u251c\u2500\u2500 contrib \u251c\u2500\u2500 cr \u251c\u2500\u2500 extras \u251c\u2500\u2500 fasttrack \u251c\u2500\u2500 isos \u251c\u2500\u2500 os \u2502\u00a0\u00a0 \u2514\u2500\u2500 x86_64 \u2502\u00a0\u00a0 \u251c\u2500\u2500 EFI \u2502\u00a0\u00a0 \u251c\u2500\u2500 images \u2502\u00a0\u00a0 \u251c\u2500\u2500 isolinux \u2502\u00a0\u00a0 \u251c\u2500\u2500 Packages \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 MariaDB-5.5.31-centos6-x86_64-client.rpm [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-5333","post","type-post","status-publish","format-standard","hentry","category-life"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5333"}],"version-history":[{"count":8,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5333\/revisions"}],"predecessor-version":[{"id":5339,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5333\/revisions\/5339"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}