{"id":70,"date":"2026-10-30T12:00:30","date_gmt":"2026-10-30T20:00:30","guid":{"rendered":"\/?p=70"},"modified":"2026-10-30T12:00:30","modified_gmt":"2026-10-30T20:00:30","slug":"post-mvug2c95","status":"publish","type":"post","link":"https:\/\/www.woiov.cn\/?p=70","title":{"rendered":"Ubuntu 24.04 \u7684 sources.list \u662f\u4e2a\u7a7a\u58f3\uff1a\u4e00\u6b21 275 \u79d2\u521d\u59cb\u5316\u8d85\u65f6\u7684\u590d\u76d8"},"content":{"rendered":"<p>Ubuntu 24.04 \u7684 <code>\/etc\/apt\/sources.list<\/code> \u662f\u4e2a\u7a7a\u58f3\u3002<\/p>\n<p>\u8fd9\u53e5\u8bdd\u89e3\u91ca\u4e86\u6211\u4eec\u4e0a\u5468\u4e00\u6b21\u521d\u59cb\u5316\u5361 275 \u79d2\u7684\u539f\u56e0\u3002\u5bb9\u5668\u5f00\u4e86\u3001IP \u6709\u4e86\u300122 \u7aef\u53e3\u901a\u4e86\uff0c<code>sudo<\/code> \u5374\u6ca1\u88c5\u4e0a\uff0c\u524d\u7aef\u4e00\u76f4\u8f6c\u5708\uff0c\u6700\u540e\u62a5\u300c\u521d\u59cb\u5316\u8d85\u65f6\u300d\u3002\u67e5\u5230\u6700\u540e\uff0c\u4e0d\u662f PVE \u7684\u95ee\u9898\uff0c\u4e0d\u662f\u7f51\u7edc\u7684\u95ee\u9898\uff0c\u662f\u8f6f\u4ef6\u6e90\u7684\u95ee\u9898\u2014\u2014\u6211\u4eec\u6362\u6e90\u7684\u90a3\u884c\u811a\u672c\uff0c\u6539\u7684\u662f\u4e00\u4e2a\u5df2\u7ecf\u4e0d\u751f\u6548\u7684\u6587\u4ef6\u3002<\/p>\n<h3>\u73b0\u8c61\uff1a\u673a\u5668\u662f\u6d3b\u7684\uff0c\u5de5\u5177\u662f\u7f3a\u7684<\/h3>\n<p>\u90a3\u6b21\u4ea4\u4ed8\u7684\u662f\u4e00\u53f0 Ubuntu 24.04\uff08noble\uff09\u3002\u6309\u6d41\u7a0b\u8d70\u5230\u300c\u521d\u59cb\u5316\u7cfb\u7edf\u300d\u9636\u6bb5\uff0c\u7b49\u4e86\u56db\u5206\u534a\u949f\uff0c\u72b6\u6001\u5361\u4f4f\u3002\u5230 PVE \u91cc\u770b\uff1a<\/p>\n<ul>\n<li><code>status=running<\/code> \u2705<\/li>\n<li><code>\/interfaces<\/code> \u8fd4\u56de 10.x \u5730\u5740 \u2705<\/li>\n<li><code>TCP:22<\/code> \u80fd\u8fde \u2705<\/li>\n<li>\u4f46 <code>curl<\/code>\u3001<code>git<\/code>\u3001<code>sudo<\/code> \u4e00\u4e2a\u90fd\u6ca1\u6709 \u274c<\/li>\n<\/ul>\n<p>\u6309\u5f53\u65f6\u7684\u5224\u5b9a\u903b\u8f91\uff0c\u5de5\u5177\u4e0d\u5168\u5c31\u5224\u5931\u8d25\u3002\u4f46\u673a\u5668\u660e\u660e\u662f\u597d\u7684\uff0c\u7528\u6237\u4e5f\u80fd SSH \u8fdb\u53bb\u2014\u2014\u53ea\u662f\u4ec0\u4e48\u4e5f\u5e72\u4e0d\u4e86\u3002\u8fd9\u6bd4\u5f7b\u5e95\u5931\u8d25\u66f4\u5c34\u5c2c\uff1a\u8ba2\u5355\u505c\u5728\u300c\u521d\u59cb\u5316\u4e2d\u300d\uff0c\u7528\u6237\u4ee5\u4e3a\u6211\u4eec\u5728\u9a97\u4ed6\u3002<\/p>\n<h3>\u7b2c\u4e00\u5c42\u6839\u56e0\uff1a\u6362\u6e90\u6539\u9519\u4e86\u6587\u4ef6<\/h3>\n<p>Ubuntu 24.04 \u8d77\u9ed8\u8ba4\u4f7f\u7528 deb822 \u683c\u5f0f\uff0c\u6e90\u5b9a\u4e49\u642c\u5230\u4e86 <code>\/etc\/apt\/sources.list.d\/ubuntu.sources<\/code>\uff1a<\/p>\n<pre class=\"wp-block-code\"><code>\nTypes: deb\nURIs: http:\/\/archive.ubuntu.com\/ubuntu\nSuites: noble noble-updates noble-security\nComponents: main restricted universe multiverse\nSigned-By: \/usr\/share\/keyrings\/ubuntu-archive-keyring.gpg\n<\/code><\/pre>\n<p>\u800c <code>\/etc\/apt\/sources.list<\/code> \u91cc\u901a\u5e38\u53ea\u5269\u6ce8\u91ca\u3002\u6211\u4eec\u65e7\u811a\u672c\u662f\u8fd9\u4e48\u6362\u6e90\u7684\uff1a<\/p>\n<pre class=\"wp-block-code\"><code>\ncat &gt; \/etc\/apt\/sources.list &lt;&lt;EOF\ndeb https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ $CN main restricted universe multiverse\n...\nEOF\n<\/code><\/pre>\n<p>\u770b\u8d77\u6765\u5f88\u5408\u7406\uff0c\u5b9e\u9645\u4e0a\u7b49\u4e8e\u5f80\u4e00\u4e2a\u6ca1\u4eba\u8bfb\u7684\u6587\u4ef6\u91cc\u5199\u914d\u7f6e\u3002<code>ubuntu.sources<\/code> \u539f\u5c01\u4e0d\u52a8\uff0carchive.ubuntu.com \u4f9d\u7136\u662f\u6d3b\u8dc3\u6e90\u3002\u56fd\u5185\u5bb9\u5668\u8bbf\u95ee\u6d77\u5916 archive\uff0c<code>apt-get update<\/code> \u5728\u90a3\u8fb9\u9010\u4e2a\u91cd\u8bd5\u8d85\u65f6\uff0c\u51e0\u767e\u4e2a\u5305\u7d22\u5f15\u4e00\u4e2a\u4e5f\u4e0b\u4e0d\u6765\u2014\u2014\u8fd9\u5c31\u662f 275 \u79d2\u7684\u6765\u6e90\u3002<\/p>\n<p><strong>\u6559\u8bad\u4e00\u53e5\u8bdd<\/strong>\uff1aDebian\/Ubuntu \u73b0\u5728\u6709\u4e24\u5957\u6e90\u6587\u4ef6\u683c\u5f0f\u5e76\u5b58\uff0c\u53ea\u6539\u4e00\u5957\u7b49\u4e8e\u6ca1\u6539\u3002<\/p>\n<h3>\u7b2c\u4e8c\u5c42\u6839\u56e0\uff1a\u62ff\u65e5\u5fd7\u5b57\u6837\u5224\u6210\u8d25<\/h3>\n<p>\u65e7\u903b\u8f91\u662f\u6293\u521d\u59cb\u5316\u811a\u672c\u7684\u8f93\u51fa\uff0c\u770b\u5230\u300c\u6210\u529f\u300d\u5b57\u6837\u5c31\u7b97\u8fc7\u3002\u95ee\u9898\u662f apt \u7684\u5931\u8d25\u5927\u591a\u662f\u9759\u9ed8\u7684\uff1a<code>apt-get install -y -qq<\/code> \u8fd4\u56de\u975e\u96f6\uff0c\u811a\u672c\u91cc\u4e00\u53e5 <code>|| true<\/code> \u541e\u6389\uff0c\u65e5\u5fd7\u770b\u8d77\u6765\u5e72\u5e72\u51c0\u51c0\u3002\u4e8e\u662f\u300c\u8dd1\u5b8c\u4e86\u300d\u548c\u300c\u88c5\u4e0a\u4e86\u300d\u88ab\u6df7\u4e3a\u4e00\u8c08\u3002<\/p>\n<p>\u6539\u6210\u5b9e\u6d4b\u63a2\u9488\uff0c\u4e00\u4e2a\u5de5\u5177\u4e00\u4e2a\u68c0\u67e5\u51fd\u6570\uff1a<\/p>\n<pre class=\"wp-block-code\"><code>\ntool_ready() {\n  case \"$1\" in\n    openssh-server) [ -x \/usr\/sbin\/sshd ] || command -v sshd &gt;\/dev\/null 2&gt;&amp;1 ;;\n    ca-certificates) [ -f \/etc\/ssl\/certs\/ca-certificates.crt ] ;;\n    sudo) command -v sudo &gt;\/dev\/null 2&gt;&amp;1 ;;\n    *) command -v \"$1\" &gt;\/dev\/null 2&gt;&amp;1 ;;\n  esac\n}\n\nfor t in $CORE_TOOLS; do tool_ready \"$t\" || MISSING=\"$MISSING $t\"; done\n<\/code><\/pre>\n<p>\u5224\u5b9a\u6807\u51c6\u53d8\u6210\uff1a<strong>lihua \u80fd\u767b\u5f55 + \u6838\u5fc3\u5de5\u5177\u9f50\u5168<\/strong>\u3002\u4e0d\u770b\u65e5\u5fd7\u5199\u4e86\u4ec0\u4e48\uff0c\u53ea\u770b\u6587\u4ef6\u5728\u4e0d\u5728\u3001\u547d\u4ee4\u8dd1\u4e0d\u8dd1\u5f97\u8d77\u6765\u3002<\/p>\n<h3>\u4e09\u5c42\u4fee\u6cd5<\/h3>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>\u5c42\u9762<\/th>\n<th>\u65e7\u505a\u6cd5<\/th>\n<th>\u65b0\u505a\u6cd5<\/th>\n<th>\u6548\u679c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u6e90\u6587\u4ef6<\/td>\n<td>\u53ea\u5199 <code>sources.list<\/code><\/td>\n<td>\u540c\u65f6\u8bc6\u522b <code>sources.list<\/code> \u4e0e <code>sources.list.d\/*.sources<\/code><\/td>\n<td>Ubuntu 24.04 \/ Debian 12 \u90fd\u80fd\u6362\u5230\u6e05\u534e\u955c\u50cf<\/td>\n<\/tr>\n<tr>\n<td>\u53d1\u884c\u7248\u8bc6\u522b<\/td>\n<td>\u4e0d\u533a\u5206<\/td>\n<td>\u8bfb <code>\/etc\/os-release<\/code> \u7684 <code>ID<\/code> + <code>VERSION_CODENAME<\/code><\/td>\n<td>Debian \u7528 bookworm\uff0cUbuntu \u7528 noble\uff0c\u4e0d\u4f1a\u4e32<\/td>\n<\/tr>\n<tr>\n<td>\u975e Debian \u7cfb<\/td>\n<td>\u7ee7\u7eed\u8dd1\uff0c\u767d\u7b49<\/td>\n<td>\u68c0\u6d4b\u4e0d\u5230 <code>apt-get<\/code> \u7acb\u5373 die<\/td>\n<td>5 \u79d2\u5931\u8d25\uff0c\u4e0d\u8017 300 \u79d2<\/td>\n<\/tr>\n<tr>\n<td>\u6210\u8d25\u5224\u5b9a<\/td>\n<td>\u6293\u65e5\u5fd7\u5b57\u6837<\/td>\n<td>\u5b9e\u6d4b\u63a2\u9488 + \u4e8c\u6b21\u8865\u88c5<\/td>\n<td>\u300c\u8dd1\u5b8c\u4e86\u300d\u2260\u300c\u88c5\u4e0a\u4e86\u300d<\/td>\n<\/tr>\n<tr>\n<td>\u5907\u4efd<\/td>\n<td>\u65e0<\/td>\n<td><code>sources.list.lihua-bak<\/code> + <code>*.sources.lihua-bak<\/code><\/td>\n<td>\u51fa\u95ee\u9898\u80fd\u56de\u6eda<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u6362\u6e90\u4e3b\u4f53\u73b0\u5728\u957f\u8fd9\u6837\uff0c\u56db\u6761\u5206\u652f\u5168\u94fa\u5f00\uff1a<\/p>\n<pre class=\"wp-block-code\"><code>\ncase \"$OS_ID\" in\n  debian)\n    if ls \/etc\/apt\/sources.list.d\/*.sources &gt;\/dev\/null 2&gt;&amp;1; then\n      for f in \/etc\/apt\/sources.list.d\/*.sources; do\n        sed -i -E \"s#URIs:.*#URIs: https:\/\/mirrors.tuna.tsinghua.edu.cn\/debian#g\" \"$f\"\n      done\n    else\n      printf 'deb https:\/\/mirrors.tuna.tsinghua.edu.cn\/debian\/ %s main ...\\n' \"$CN\" \\\n        &gt; \/etc\/apt\/sources.list\n    fi\n    ;;\n  ubuntu)  # \u540c\u4e0a\uff0c\u5957\u4ef6\u540d\u6362\u6210 noble\/jammy\n    ;;\nesac\n<\/code><\/pre>\n<p>\u53e6\u5916\u8865\u4e86\u4e00\u4e2a\u300c\u4e8c\u6b21\u8865\u88c5\u300d\uff1a\u7b2c\u4e00\u6b21 <code>apt-get install<\/code> \u4e4b\u540e\u91cd\u65b0\u63a2\u9488\uff0c\u7f3a\u4ec0\u4e48\u518d\u5355\u72ec\u88c5\u4e00\u904d\uff0c\u8fd8\u662f\u7f3a\u5c31\u76f4\u63a5\u7ea2\u5b57\u9000\u51fa\u5e76\u6307\u660e\u7f3a\u54ea\u4e2a\u3002\u5b81\u53ef 60 \u79d2\u62a5\u9519\uff0c\u4e5f\u4e0d\u8981 275 \u79d2\u540e\u542b\u7cca\u5176\u8bcd\u3002<\/p>\n<h3>\u590d\u76d8\uff1a\u6162\u5931\u8d25\u6bd4\u5feb\u5931\u8d25\u8d35<\/h3>\n<p>\u8fd9\u6b21\u6700\u8d35\u7684\u4e0d\u662f\u4ee3\u7801\uff0c\u662f<strong>\u8bef\u5224<\/strong>\u3002\u7cfb\u7edf\u62a5\u300c\u521d\u59cb\u5316\u8d85\u65f6\u300d\uff0c\u7b2c\u4e00\u53cd\u5e94\u662f PVE \u6162\u3001\u7f51\u7edc\u5dee\u3001\u6a21\u677f\u6709\u95ee\u9898\uff0c\u6765\u56de\u67e5\u4e86\u4e24\u5c0f\u65f6\u3002\u771f\u6b63\u7684\u7ebf\u7d22\u53ea\u6709\u4e00\u6761\uff1a\u673a\u5668\u6d3b\u7740\u4f46\u5de5\u5177\u7f3a\u5931\u2014\u2014\u8fd9\u6392\u9664\u4e86\u8d44\u6e90\u5c42\uff0c\u76f4\u6307\u8f6f\u4ef6\u6e90\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u540e\u6765\u52a0\u4e86\u4e24\u6761\u786c\u89c4\u5219\uff1a<\/p>\n<p>1. <strong>\u5feb\u901f\u5931\u8d25\u4f18\u5148<\/strong>\u3002\u4e0d\u77e5\u9053\u53d1\u884c\u7248\u5c31\u8bf4\u4e0d\u77e5\u9053\uff0c\u7136\u540e\u7acb\u523b\u505c\u3002\u4e0d\u8bb8\u300c\u8bd5\u8bd5\u770b\u80fd\u4e0d\u80fd\u8dd1\u300d\u3002<\/p>\n<p>2. <strong>\u5224\u5b9a\u9760\u89c2\u6d4b\uff0c\u4e0d\u9760\u81ea\u8ff0<\/strong>\u3002\u811a\u672c\u8bf4\u81ea\u5df1\u6210\u529f\u4e86\u6ca1\u6709\u610f\u4e49\uff0c\u7aef\u53e3\u901a\u4e0d\u901a\u3001\u547d\u4ee4\u5728\u4e0d\u5728\u624d\u6709\u610f\u4e49\u3002<\/p>\n<p>\u540c\u4e00\u5957\u903b\u8f91\u540e\u6765\u4e5f\u7528\u5728\u5bb9\u5668\u81ea\u52a8\u4e0a\u62a5\u4e0a\uff1a\u4e0d\u4fe1\u4e0a\u62a5\u811a\u672c\u7684\u8fd4\u56de\u7801\uff0c\u670d\u52a1\u7aef\u81ea\u5df1\u6838\u5bf9\u5b57\u6bb5\u5b8c\u6574\u6027\u3002<\/p>\n<hr class=\"wp-block-separator\"\/>\n<p><em>\u72f8\u82b1\u4e91 v7.20.5\uff0c2026-10-30<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 24.04 \u7684 \/etc\/apt\/sources.list \u662f\u4e2a\u7a7a\u58f3\u3002 \u8fd9\u53e5\u8bdd\u89e3\u91ca\u4e86\u6211\u4eec\u4e0a\u5468\u4e00\u6b21\u521d\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-cat-e68a80e69cafe697"],"_links":{"self":[{"href":"https:\/\/www.woiov.cn\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.woiov.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.woiov.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.woiov.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.woiov.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":0,"href":"https:\/\/www.woiov.cn\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.woiov.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.woiov.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.woiov.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}