{"id":46047,"date":"2023-04-16T01:27:37","date_gmt":"2023-04-15T17:27:37","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=46047"},"modified":"2023-04-16T01:27:37","modified_gmt":"2023-04-15T17:27:37","slug":"apt-mirror-yum","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/apt-mirror-yum.html","title":{"rendered":"\u4f7f\u7528 APT-mirror \u56db\u6b65\u914d\u7f6e Ubuntu \u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u6211\u4eec\u5c06\u5411\u4f60\u5c55\u793a\u5982\u4f55\u5728\u4f60\u7684 Ubuntu \u4e2a\u4eba\u7535\u8111\u6216 Ubuntu \u670d\u52a1\u5668\u4e2d\uff0c\u76f4\u63a5\u901a\u8fc7 Ubuntu \u5b98\u65b9\u8f6f\u4ef6\u4ed3\u5e93\u6765\u914d\u7f6e\u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93\u3002\u5728\u4f60\u7684\u7535\u8111\u4e2d\u521b\u5efa\u4e00\u4e2a\u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93\u6709\u7740\u8bb8\u591a\u7684\u597d\u5904\u3002\u5047\u5982\u4f60\u6709\u8bb8\u591a\u7535\u8111\u9700\u8981\u5b89\u88c5\u8f6f\u4ef6 \u3001\u5b89\u5168\u5347\u7ea7\u548c\u4fee\u590d\u8865\u4e01\uff0c\u90a3\u4e48\u914d\u7f6e\u4e00\u4e2a\u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93\u662f\u4e00\u4e2a\u505a\u8fd9\u4e9b\u4e8b\u60c5\u7684\u9ad8\u6548\u65b9\u6cd5\u3002\u56e0\u4e3a\uff0c\u6240\u6709\u9700\u8981\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u90fd\u53ef\u4ee5\u901a\u8fc7\u5feb\u901f\u7684\u5c40\u57df\u7f51\u8fde\u63a5\u4ece\u4f60\u7684\u672c\u5730\u670d\u52a1\u5668\u4e2d\u4e0b\u8f7d\uff0c\u8fd9\u6837\u53ef\u4ee5\u8282\u7701\u4f60\u7684\u7f51\u7edc\u5e26\u5bbd\uff0c\u964d\u4f4e\u4e92\u8054\u7f51\u63a5\u5165\u7684\u5e74\u5ea6\u5f00\u652f\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4ecb\u7ecdAPT-Mirror<\/strong><\/div>\n

\u4f60\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5de5\u5177\u5728\u4f60\u7684\u672c\u5730\u4e2a\u4eba\u7535\u8111\u6216\u670d\u52a1\u5668\u4e2d\u914d\u7f6e\u4e00\u4e2a Ubuntu \u7684\u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93\uff0c\u4f46\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4e3a\u4f60\u4ecb\u7ecd APT-Mirror\u3002\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u628a\u9ed8\u8ba4\u7684\u955c\u50cf\u5305\u955c\u50cf\u5230\u6211\u4eec\u672c\u5730\u7684\u670d\u52a1\u5668\u6216\u4e2a\u4eba\u7535\u8111\u4e2d\uff0c\u5e76\u4e14\u5728\u4f60\u7684\u672c\u5730\u6216\u5916\u7f6e\u786c\u76d8\u4e2d\uff0c\u6211\u4eec\u81f3\u5c11\u9700\u8981 120 GB \u6216\u66f4\u591a\u7684\u53ef\u7528\u7a7a\u95f4\u624d\u884c\u3002 \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u4e00\u4e2a HTTP \u6216 FTP \u670d\u52a1\u5668\u6765\u4e0e\u672c\u5730\u7cfb\u7edf\u5ba2\u6237\u7aef\u5171\u4eab\u8fd9\u4e2a\u8f6f\u4ef6\u4ed3\u5e93\u3002<\/p>\n

\"\"<\/p>\n

\n\u6211\u4eec\u9700\u8981\u5b89\u88c5 Apache \u7f51\u7edc\u670d\u52a1\u5668\u548c APT-Mirror \u6765\u4f7f\u5f97\u6211\u4eec\u7684\u5de5\u4f5c\u5f97\u4ee5\u5f00\u59cb\u3002\u4e0b\u9762\u662f\u914d\u7f6e\u4e00\u4e2a\u53ef\u5de5\u4f5c\u7684\u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93\u7684\u6b65\u9aa4\uff1a\n<\/p>\n

1. \u5b89\u88c5\u9700\u8981\u7684\u8f6f\u4ef6\u5305<\/strong><\/div>\n

\u6211\u4eec\u9700\u8981\u4ece Ubuntu \u7684\u516c\u5171\u8f6f\u4ef6\u5305\u4ed3\u5e93\u4e2d\u53d6\u5f97\u6240\u6709\u7684\u8f6f\u4ef6\u5305\uff0c\u7136\u540e\u5728\u6211\u4eec\u672c\u5730\u7684 Ubuntu \u670d\u52a1\u5668\u786c\u76d8\u4e2d\u4fdd\u5b58\u5b83\u4eec\u3002<\/p>\n

\u9996\u5148\u6211\u4eec\u5b89\u88c5\u4e00\u4e2aWeb \u670d\u52a1\u5668\u6765\u627f\u8f7d\u6211\u4eec\u7684\u672c\u5730\u8f6f\u4ef6\u4ed3\u5e93\u3002\u8fd9\u91cc\u6211\u4eec\u5c06\u5b89\u88c5 Apache Web \u670d\u52a1\u5668\uff0c\u4f46\u4f60\u53ef\u4ee5\u5b89\u88c5\u4efb\u4f55\u4f60\u4e2d\u610f\u7684 Web \u670d\u52a1\u5668\u3002\u5bf9\u4e8e http \u534f\u8bae\uff0cWeb \u670d\u52a1\u5668\u662f\u5fc5\u987b\u7684\u3002\u5047\u5982\u4f60\u9700\u8981\u914d\u7f6e ftp \u534f\u8bae \u53ca rsync \u534f\u8bae\uff0c\u4f60\u8fd8\u53ef\u4ee5\u518d\u5206\u522b\u989d\u5916\u5b89\u88c5 FTP \u670d\u52a1\u5668\uff0c\u5982 proftpd, vsftpd \u7b49\u7b49 \u548c Rsync \u3002\n<\/p>\n

1.$ sudo apt-get install apache2<\/pre>\n

\u7136\u540e\u6211\u4eec\u9700\u8981\u5b89\u88c5 apt-mirror:<\/p>\n

1.$ sudo apt-get install apt-mirror<\/pre>\n

\"\"<\/p>\n

2. \u914d\u7f6e APT-Mirror<\/strong><\/div>\n

\u73b0\u5728\uff0c\u5728\u4f60\u7684\u786c\u76d8\u4e0a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u6765\u4fdd\u5b58\u6240\u6709\u7684\u8f6f\u4ef6\u5305\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a \/linoxide\u7684\u76ee\u5f55\uff0c\u6211\u4eec\u5c06\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u4fdd\u5b58\u6240\u6709\u7684\u8f6f\u4ef6\u5305\uff1a<\/p>\n

1. $ sudo mkdir \/linoxide<\/pre>\n

\u73b0\u5728\uff0c\u6253\u5f00\u6587\u4ef6 \/etc\/apt\/mirror.list :<\/p>\n

1. $ sudo nano \/etc\/apt\/mirror.list<\/pre>\n

\u590d\u5236\u4e0b\u9762\u7684\u547d\u4ee4\u884c\u914d\u7f6e\u5230 mirror.list\u6587\u4ef6\u4e2d\u5e76\u6309\u7167\u4f60\u7684\u9700\u6c42\u8fdb\u884c\u4fee\u6539\uff1a<\/p>\n

\r\n\r\n1.############# config ##################\r\n2.#\r\n3.set base_path    \/linoxide\r\n4.#\r\n5.# set mirror_path  $base_path\/mirror\r\n6.# set skel_path    $base_path\/skel\r\n7.# set var_path     $base_path\/var\r\n8.# set cleanscript $var_path\/clean.sh\r\n9.# set defaultarch  \r\n10.# set postmirror_script $var_path\/postmirror.sh\r\n11.# set run_postmirror 0\r\n12.set nthreads     20\r\n13.set _tilde 0\r\n14.#\r\n15.############# end config ##############\r\n16. \r\n17.deb http:\/\/archive.ubuntu.com\/ubuntu trusty main restricted universe multiverse\r\n18.deb http:\/\/archive.ubuntu.com\/ubuntu trusty-security main restricted universe multiverse\r\n19.deb http:\/\/archive.ubuntu.com\/ubuntu trusty-updates main restricted universe multiverse\r\n20.#deb http:\/\/archive.ubuntu.com\/ubuntu trusty-proposed main restricted universe multiverse\r\n21.#deb http:\/\/archive.ubuntu.com\/ubuntu trusty-backports main restricted universe multiverse\r\n22. \r\n23.deb-src http:\/\/archive.ubuntu.com\/ubuntu trusty main restricted universe multiverse\r\n24.deb-src http:\/\/archive.ubuntu.com\/ubuntu trusty-security main restricted universe multiverse\r\n25.deb-src http:\/\/archive.ubuntu.com\/ubuntu trusty-updates main restricted universe multiverse\r\n26.#deb-src http:\/\/archive.ubuntu.com\/ubuntu trusty-proposed main restricted universe multiverse\r\n27.#deb-src http:\/\/archive.ubuntu.com\/ubuntu trusty-backports main restricted universe multiverse\r\n28. \r\n29.clean http:\/\/archive.ubuntu.com\/\r\n\r\n<\/running><\/pre>\n

\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u8981\u955c\u50cf\u6700\u65b0\u548c\u6700\u5927\u7684 Ubuntu LTS \u53d1\u884c\u7248 --- \u5373 Ubuntu 14.04 LTS (Trusty Tahr) --- \u7684\u8f6f\u4ef6\u5305\u4ed3\u5e93\uff0c\u6240\u4ee5\u5728\u4e0a\u9762\u7684\u914d\u7f6e\u4e2d\u53d1\u884c\u7248\u672c\u53f7\u4e3a trusty \u3002\u5047\u5982\u6211\u4eec\u9700\u8981\u955c\u50cf Saucy \u6216\u5176\u4ed6\u7684 Ubuntu \u53d1\u884c\u7248\u672c\uff0c\u8bf7\u4fee\u6539\u4e0a\u9762\u7684 trusy \u4e3a\u76f8\u5e94\u7684\u4ee3\u53f7\u3002<\/p>\n

\u73b0\u5728\uff0c\u6211\u4eec\u5fc5\u987b\u8fd0\u884c apt-mirror \u6765\u4e0b\u8f7d\u6216\u955c\u50cf\u5b98\u65b9\u4ed3\u5e93\u4e2d\u7684\u6240\u6709\u8f6f\u4ef6\u5305\u3002<\/p>\n

1.sudo apt-mirror<\/pre>\n

\u4ece Ubuntu \u670d\u52a1\u5668\u4e2d\u4e0b\u8f7d\u6240\u6709\u7684\u8f6f\u4ef6\u5305\u6240\u82b1\u8d39\u7684\u65f6\u95f4\u53d6\u51b3\u4e8e\u4f60\u548c\u955c\u50cf\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u7f51\u7edc\u8fde\u63a5\u901f\u7387\u548c\u6027\u80fd\u3002\u8fd9\u91cc\u6211\u4e2d\u65ad\u4e86\u4e0b\u8f7d\uff0c\u56e0\u4e3a\u6211\u5df2\u7ecf\u4e0b\u8f7d\u597d\u4e86 ...<\/p>\n

\"\"<\/p>\n

3.\u914d\u7f6e\u7f51\u7edc\u670d\u52a1\u5668<\/strong><\/div>\n

\u4e3a\u4e86\u4f7f\u5f97\u5176\u4ed6\u7684\u7535\u8111\u80fd\u591f\u8bbf\u95ee\u8fd9\u4e2a\u8f6f\u4ef6\u4ed3\u5e93\uff0c\u4f60\u9700\u8981\u4e00\u4e2aWeb\u670d\u52a1\u5668\u3002\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7 ftp \u6765\u5b8c\u6210\u8fd9\u4ef6\u4e8b\uff0c\u4f46\u6211\u9009\u62e9\u4f7f\u7528\u4e00\u4e2aWeb\u670d\u52a1\u5668\u56e0\u4e3a\u5728\u4e0a\u9762\u7684\u6b65\u9aa4 1 \u4e2d\u6211\u63d0\u53ca\u5230\u4f7f\u7528Web\u670d\u52a1\u5668\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u73b0\u5728\u8981\u5bf9 Apache \u670d\u52a1\u5668\u8fdb\u884c\u914d\u7f6e:<\/p>\n

\u6211\u4eec\u5c06\u4e3a\u6211\u4eec\u672c\u5730\u7684\u8f6f\u4ef6\u4ed3\u5e93\u76ee\u5f55 \u5efa\u7acb\u4e00\u4e2a\u5230 Apache \u6258\u7ba1\u76ee\u5f55 --- \u5373 \/var\/www\/ubuntu --- \u7684\u7b26\u53f7\u94fe\u63a5\u3002<\/p>\n

1.$ sudo ln -s \/linoxide \/var\/www\/ubuntu\r\n2.$ sudo service apache2 start\r\n<\/pre>\n

\u4e0a\u9762\u7684\u547d\u4ee4\u5c06\u5141\u8bb8\u6211\u4eec\u4ece\u672c\u5730\u4e3b\u673a(localhost) --- \u5373 http:\/\/127.0.0.1(\u9ed8\u8ba4\u60c5\u51b5\u4e0b) --- \u6d4f\u89c8\u6211\u4eec\u7684\u955c\u50cf\u8f6f\u4ef6\u4ed3\u5e93\u3002<\/p>\n

4. \u914d\u7f6e\u5ba2\u6237\u7aef<\/strong><\/div>\n

\u6700\u540e\uff0c\u6211\u4eec\u9700\u8981\u5728\u5176\u4ed6\u7684\u7535\u8111\u4e2d\u6dfb\u52a0\u8f6f\u4ef6\u6e90\uff0c\u6765\u4f7f\u5f97\u5b83\u4eec\u53ef\u4ee5\u4ece\u6211\u4eec\u7684\u7535\u8111\u4e2d\u53d6\u5f97\u8f6f\u4ef6\u5305\u6216\u8f6f\u4ef6\u4ed3\u5e93\u3002\u4e3a\u8fbe\u5230\u6b64\u76ee\u7684\uff0c\u6211\u4eec\u9700\u8981\u7f16\u8f91 \/etc\/apt\/sources.list \u6587\u4ef6\u5e76\u6dfb\u52a0\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n

1.$ sudo nano \/etc\/apt\/sources.list<\/pre>\n

\u6dfb\u52a0\u4e0b\u9762\u7684\u4e00\u884c\u5230\/etc\/apt\/sources.list\u4e2d\u5e76\u4fdd\u5b58\u3002<\/p>\n

1.deb http:\/\/192.168.0.100\/ubuntu\/ trusty main restricted universe<\/pre>\n

\u6ce8: \u8fd9\u91cc\u7684 192.168.0.100 \u662f\u6211\u4eec\u7684\u670d\u52a1\u5668\u7535\u8111\u7684\u5c40\u57df\u7f51 IP \u5730\u5740\uff0c\u4f60\u9700\u8981\u66ff\u6362\u4e3a\u4f60\u7684\u670d\u52a1\u5668\u7535\u8111\u7684\u5c40\u57df\u7f51 IP \u5730\u5740<\/p>\n

1.$ sudo apt-get update<\/pre>\n

\u6700\u7ec8\uff0c\u6211\u4eec\u5b8c\u6210\u4e86\u4efb\u52a1\u3002\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528sudo apt-get install packagename \u547d\u4ee4\u6765\u4ece\u4f60\u7684\u672c\u5730 Ubuntu \u8f6f\u4ef6\u4ed3\u5e93\u4e2d\u5b89\u88c5\u6240\u9700\u7684\u8f6f\u4ef6\u5305\uff0c\u8fd9\u5c06\u4f1a\u662f\u9ad8\u901f\u7684\u4e14\u6d88\u8017\u5f88\u5c11\u7684\u5e26\u5bbd\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/lrxjmw.cn\/apt-mirror-yum.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/linux.cn\/article-4926-1.html<\/a>\u7f16\u8f91\uff1a\u5f20\u632f\u5b87\uff0c\u5ba1\u6838\u5458\uff1a\u82cf\u897f\u4e91<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u6211\u4eec\u5c06\u5411\u4f60\u5c55\u793a\u5982\u4f55\u5728\u4f60\u7684 Ubuntu \u4e2a\u4eba\u7535\u8111\u6216 Ubuntu \u670d\u52a1\u5668\u4e2d\uff0c\u76f4\u63a5\u901a\u8fc7 Ubuntu \u5b98\u65b9 […]<\/p>\n","protected":false},"author":310,"featured_media":46053,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-46047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/46047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=46047"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/46047\/revisions"}],"predecessor-version":[{"id":269535,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/46047\/revisions\/269535"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/46053"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=46047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=46047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=46047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}