{"id":1740,"date":"2025-12-16T17:17:34","date_gmt":"2025-12-16T09:17:34","guid":{"rendered":"https:\/\/www.yeetrack.com\/?p=1740"},"modified":"2025-12-16T17:17:34","modified_gmt":"2025-12-16T09:17:34","slug":"ubuntu%e7%a6%bb%e7%ba%bf%e6%9b%b4%e6%96%b0%e6%88%96%e8%80%85%e5%ae%89%e8%a3%85%e8%bd%af%e4%bb%b6%e5%8c%85","status":"publish","type":"post","link":"https:\/\/www.yeetrack.com\/?p=1740","title":{"rendered":"Ubuntu\u79bb\u7ebf\u66f4\u65b0\u6216\u8005\u5b89\u88c5\u8f6f\u4ef6\u5305"},"content":{"rendered":"<p>\u5728\u4f01\u4e1a\u5185\u90e8\u7684\u673a\u5668\u4e2d\uff0c\u4e3a\u4e86\u4e1a\u52a1\u548c\u5b89\u5168\u8003\u8651\uff0c\u6709\u4e00\u4e9b\u670d\u52a1\u5668\u662f\u7981\u6b62\u4e92\u8054\u7f51\u7684\uff0c\u4f46\u8fd9\u4e9b\u673a\u5668\u4e5f\u6709\u5b89\u88c5\u8f6f\u4ef6\u5305\u3001\u66f4\u65b0\u8865\u4e01\u7684\u8bc9\u6c42\u3002\u5982\u4f55\u4e3a\u4e0d\u80fd\u8054\u7f51\u7684\u673a\u5668\uff0c\u5b89\u88c5\u8f6f\u4ef6\u5462\uff1f\u4e0b\u9762\u6574\u7406\u4e09\u79cd\u65b9\u6cd5\uff1a  <\/p>\n<p>\u6ce8\u4e09\u79cd\u65b9\u6cd5\uff0c\u90fd\u5fc5\u987b\u989d\u5916\u6709\u4e00\u53f0\u80fd\u4e0a\u7f51\u7684Ubuntu\u7535\u8111\uff0c\u5e76\u4e14\u6700\u597d\u4e0e\u79bb\u7ebfUbuntu\u662f\u76f8\u540c\u7684\u5927\u7248\u672c\uff0c\u598220.04\uff1b\u5982\u679c\u4e0d\u662f\u4e00\u4e2a\u5927\u7248\u672c\uff0c\u90a3\u53ef\u4ee5\u4e34\u65f6\u4fee\u6539\u6709\u7f51Ubuntu\u7684\u66f4\u65b0\u6e90\u4e0e\u79bb\u7ebfUbuntu\u4e00\u81f4\u3002  <\/p>\n<p><!--more--><\/p>\n<h3>\u624b\u52a8\u4e0b\u8f7d\u79bb\u7ebf\u5305\u5b89\u88c5<\/h3>\n<p>\u6b64\u65b9\u6cd5\u9002\u7528\u4e8e\u5c11\u91cf\u8f6f\u4ef6\u7684\u60c5\u51b5\uff0c\u7eaf\u624b\u5de5\u5b89\u88c5\u3002\u4e0b\u9762\u662f\u5b89\u88c5nginx\u7684\u4f8b\u5b50\uff1a  <\/p>\n<ul>\n<li>\n<p>\u5728\u6709\u7f51Ubuntu\u4e0a\u67e5\u770b\u5b89\u88c5nginx\u90fd\u9700\u8981\u4ec0\u4e48\u8f6f\u4ef6\u5305\uff1a  <\/p>\n<pre><code>    ~# apt-get --print-uris install nginx | grep \"^'\" | cut -d\"'\" -f2\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/nginx-common_1.18.0-0ubuntu1.7_all.deb\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/libnginx-mod-http-image-filter_1.18.0-0ubuntu1.7_amd64.deb\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/libnginx-mod-http-xslt-filter_1.18.0-0ubuntu1.7_amd64.deb\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/libnginx-mod-mail_1.18.0-0ubuntu1.7_amd64.deb\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/libnginx-mod-stream_1.18.0-0ubuntu1.7_amd64.deb\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/nginx-core_1.18.0-0ubuntu1.7_amd64.deb\n    https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/nginx_1.18.0-0ubuntu1.7_all.deb<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5728\u6709\u7f51Ubuntu\u4e0a\u5c06\u4e0a\u9762\u7684deb\u5305\u90fd\u4e0b\u8f7d\u4e0b\u6765<\/p>\n<pre><code>    wget 'https:\/\/mirrors.aliyun.com\/ubuntu\/pool\/main\/n\/nginx\/nginx-common_1.18.0-0ubuntu1.7_all.deb'\n    ....<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5c06\u8fd9\u4e00\u5806deb\u5305\u62f7\u8d1d\u5230\u79bb\u7ebfUbuntu\u673a\u5668\u4e2d<\/p>\n<\/li>\n<li>\n<p>\u5728\u79bb\u7ebfUbuntu\u4e2d\u5b89\u88c5\uff0c<code>sudo dpkg -i *.deb<\/code><\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u6709\u4f9d\u8d56\u95ee\u9898\uff0c\u5219\u6267\u884c <code>sudo apt --fix-broken install<\/code><\/p>\n<\/li>\n<\/ul>\n<h3>\u4f7f\u7528apt-offline\u547d\u4ee4\u5b89\u88c5<\/h3>\n<p>\u5982\u679c\u9047\u5230\u5927\u91cf\u8f6f\u4ef6\uff0c\u6216\u8005\u60f3\u6267\u884c\u6279\u91cf\u66f4\u65b0\u7684\u60c5\u51b5\uff0c\u624b\u52a8\u5b89\u88c5\u5c31\u4e0d\u592a\u73b0\u5b9e\u4e86\uff0c\u53ef\u4ee5\u4f7f\u7528apt-offline\u547d\u4ee4\u3002\u4e0d\u8fc7\uff0c\u5c34\u5c2c\u7684\u662f\uff0c<strong>apt-offline<\/strong>\u8fd9\u4e2a\u8f6f\u4ef6\u672c\u8eab\u662f\u4e0d\u5305\u542b\u5728Ubuntu\u7cfb\u7edf\u4e2d\u7684\uff0c\u9700\u8981\u624b\u52a8\u5148\u5b89\u88c5\u597d\u3002<br \/>\napt-offline\u7684\u539f\u7406\u5f88\u7b80\u5355\uff0c\u5148\u5728\u79bb\u7ebfUbuntu\u4e0a\u68c0\u6d4b\u90fd\u7f3a\u5931\u54ea\u4e9b\u5305\uff0c\u628a\u7f3a\u5931\u7684\u5305\u90fd\u8bb0\u5f55\u5230\u6587\u4ef6\u4e2d\uff0c\u7136\u540e\u6709\u7f51Ubuntu\u6839\u636e\u8fd9\u4e2a\u6587\u4ef6\u53bb\u4e0b\u8f7d\u6240\u6709\u7684\u5305\uff0c\u6700\u540e\u628a\u8fd9\u4e9b\u5305\u518d\u624b\u5de5\u62f7\u8d1d\u5230\u79bb\u7ebfUbuntu\u4e2d\u5b89\u88c5\u3002\u539f\u7406\u8ddf\u624b\u52a8\u5b89\u88c5\u4e00\u6837\uff0c\u53ea\u662f\u63d0\u9ad8\u4e86\u6548\u7387\u3002   <\/p>\n<ul>\n<li>\n<p>\u5728\u79bb\u7ebfUbuntu\u4e0a\u68c0\u6d4b\u7f3a\u5931\u4ec0\u4e48\u5305\uff0c\u5c06\u7ed3\u679c\u4fdd\u5b58\u5230apt-nginx.sig\u4e2d  <\/p>\n<pre><code>apt-offline set --install-packages nginx -- apt-nginx.sig<\/code><\/pre>\n<\/li>\n<li>\u5c06apt-nginx.sig\u8fd9\u4e2a\u6587\u4ef6\u62f7\u8d1d\u5230\u6709\u7f51Ubuntu\u4e2d<\/li>\n<li>\n<p>\u5728\u6709\u7f51Ubuntu\u4e2d\u4e0b\u8f7d\u4f9d\u8d56\u7684\u5305\uff0c\u5e76\u6253\u5305\u6210nginx-bundle.zip\u538b\u7f29\u5305  <\/p>\n<pre><code>apt-offline get --bundle nginx-bundle.zip apt-nginx.sig<\/code><\/pre>\n<\/li>\n<li>\u5c06nginx-bundle.zip\u538b\u7f29\u5305\u62f7\u8d1d\u5230\u79bb\u7ebfUbuntu\u4e2d<\/li>\n<li>\n<p>\u5728\u79bb\u7ebfUbuntu\u4e2d\u52a0\u8f7d\u79bb\u7ebf\u5305<\/p>\n<pre><code>apt-offline install nginx-bundle.zip<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5728\u79bb\u7ebfUbuntu\u4e2d\u5b89\u88c5nginx\uff0c\u5982\u679c\u6709\u4f9d\u8d56\u987a\u5e8f\u95ee\u9898\uff0c\u53ef\u5148\u6267\u884c<code>apt --fix-broken install<\/code>  <\/p>\n<pre><code>apt install nginx<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u4f7f\u7528\u5185\u90e8Ubuntu\u4ee3\u7406apt\u4ed3\u5e93\uff08\u6700\u63a8\u8350\uff09<\/h3>\n<p>\u7c7b\u4f3cjava\u8bed\u8a00\u7684Maven\u79c1\u670d\uff0c\u53ef\u4ee5\u5728\u6709\u7f51Ubuntu\u4e2d\u5b89\u88c5\u4e00\u4e2aapt\u4ee3\u7406\u4ed3\u5e93\uff0c\u5f00\u653e\u7ed9\u79bb\u7ebfUbuntu\u4f7f\u7528\uff1b\u79bb\u7ebfUbuntu\u5728\u4e0b\u8f7d\u3001\u66f4\u65b0\u65f6\uff0c\u8bf7\u6c42\u7684\u662f\u5185\u90e8\u7684apt\u4ee3\u7406\uff0c\u5982\u679capt\u4ee3\u7406\u4e2d\u5df2\u7ecf\u6709\u4e86\u76f8\u5173\u5305\uff0c\u5219\u76f4\u63a5\u4e0b\u8f7d\uff1b\u6ca1\u6709\u7684\u8bdd\uff0c\u7531apt\u4ee3\u7406\u518d\u53bb\u5916\u7f51\u8bf7\u6c42\u4e0b\u8f7d\u3002apt-cacher-ng\u662f\u4e2a\u6bd4\u8f83\u597d\u7684\u89e3\u51b3\u529e\u6cd5\u3002  <\/p>\n<ul>\n<li>\n<p>\u5728\u6709\u7f51Ubuntu\u4e2d\u5b89\u88c5<strong>apt-cacher-ng<\/strong>\uff0c\u5b89\u88c5\u540e\u9ed8\u8ba4\u7aef\u53e33142 <\/p>\n<pre><code>sudo apt install apt-cacher-ng<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5728\u79bb\u7ebfUbuntu\u4e2d\u914d\u7f6eapt\u4ed3\u5e93\u4ee3\u7406\uff0c\u7f16\u8f91<strong>\/etc\/apt\/apt.conf.d\/01proxy<\/strong> <\/p>\n<pre><code>Acquire::http::Proxy \"http:\/\/\u6709\u7f51ubuntu up\u5730\u5740:3142\";<\/code><\/pre>\n<\/li>\n<li>\n<p>\u79bb\u7ebfUbuntu\u5373\u53ef\u6b63\u5e38\u4f7f\u7528apt<\/p>\n<pre><code>sudo apt update\nsudo apt install XXX\nsudo apt upgrade<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u901a\u8fc7http\u9875\u9762\u67e5\u770bapt\u4ee3\u7406\u4ed3\u5e93\u7684\u60c5\u51b5\uff0c<a href=\"http:\/\/\u6709\u7f51ubuntu\">http:\/\/\u6709\u7f51ubuntu<\/a> ip\u5730\u5740:3142\/acng-report.html<br \/>\n<a href=\"https:\/\/image.yeetrack.com\/wp-content\/uploads\/2025\/12\/apt.png\"><img decoding=\"async\" src=\"https:\/\/image.yeetrack.com\/wp-content\/uploads\/2025\/12\/apt.png\" alt=\"\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f01\u4e1a\u5185\u90e8\u7684\u673a\u5668\u4e2d\uff0c\u4e3a\u4e86\u4e1a\u52a1\u548c\u5b89\u5168\u8003\u8651\uff0c\u6709\u4e00\u4e9b\u670d\u52a1\u5668\u662f\u7981\u6b62\u4e92\u8054\u7f51\u7684\uff0c\u4f46\u8fd9\u4e9b\u673a\u5668\u4e5f\u6709\u5b89\u88c5\u8f6f\u4ef6\u5305\u3001\u66f4\u65b0\u8865\u4e01\u7684\u8bc9\u6c42\u3002\u5982\u4f55\u4e3a\u4e0d\u80fd\u8054\u7f51\u7684\u673a\u5668\uff0c\u5b89\u88c5\u8f6f\u4ef6\u5462\uff1f\u4e0b\u9762\u6574\u7406\u4e09\u79cd\u65b9\u6cd5\uff1a \u6ce8\u4e09\u79cd\u65b9\u6cd5\uff0c\u90fd\u5fc5\u987b\u989d\u5916\u6709\u4e00\u53f0\u80fd\u4e0a\u7f51\u7684&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[34],"tags":[11,12],"class_list":["post-1740","post","type-post","status-publish","format-standard","hentry","category-software","tag-linux","tag-ubuntu"],"views":168,"_links":{"self":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/1740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1740"}],"version-history":[{"count":1,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/1740\/revisions"}],"predecessor-version":[{"id":1742,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/1740\/revisions\/1742"}],"wp:attachment":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}