{"id":574,"date":"2025-08-08T16:23:25","date_gmt":"2025-08-08T08:23:25","guid":{"rendered":"https:\/\/windywind.tk\/?p=574"},"modified":"2025-08-08T17:25:56","modified_gmt":"2025-08-08T09:25:56","slug":"ubuntu-%e7%a6%bb%e7%ba%bf%e5%ae%89%e8%a3%85%e8%bd%af%e4%bb%b6%e5%8c%85","status":"publish","type":"post","link":"https:\/\/windywind.tk\/?p=574","title":{"rendered":"Ubuntu \u79bb\u7ebf\u5b89\u88c5\u8f6f\u4ef6\u5305"},"content":{"rendered":"\n<p>\u7531\u4e8e\u6211\u53ef\u80fd\u8981\u6279\u91cf\u5b89\u88c5\u4e00\u6279\u8fb9\u7f18\u76d2\u5b50\uff0c\u6240\u4ee5\uff0c\u6211\u5e0c\u671b\u5728\u81ea\u52a8\u5316\u5b89\u88c5\u7cfb\u7edf\u540e\uff0c\u5c3d\u91cf\u901a\u8fc7\u79bb\u7ebf.deb\u5305\u7684\u5f62\u5f0f\u5b89\u88c5\u684c\u9762\u73af\u5883\uff08ubuntu-desktop-minimal\uff09\u548cfirefox\u3002<\/p>\n\n\n\n<p>\u5047\u8bbe\u6709\u4e24\u53f0\u673a\u5668\uff0c\u7b2c\u4e00\u53f0\u53eb\u505a\u201c\u8054\u7f51\u673a\u201d\uff0c\u7b2c\u4e8c\u53f0\u53eb\u505a\u201c\u79bb\u7ebf\u673a\u201d\u3002\u6211\u5728\u8054\u7f51\u673a\u4e0a\u914d\u7f6e\u4e86\u56fd\u5185\u7684apt\u6e90\uff0c\u5e76\u7ecf\u8fc7\u4e86\u6f2b\u957f\u7b49\u5f85\uff08\u662f\u7684\uff0c\u54ea\u6015\u56fd\u5185\u6e90\uff0c\u4e0b\u8f7d\u4e5f\u8981\u5f88\u957f\u65f6\u95f4\uff09\uff0c\u6210\u529f\u5b89\u88c5\u4e86ubuntu-desktop-minimal\u548cfirefox\u3002\u7ecf\u8fc7\u4e00\u756a\u63a2\u7d22\u548c\u9a8c\u8bc1\uff0c\u6211\u5f97\u51fa\u4e86\u4ee5\u4e0b\u65b9\u6848\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u603b\u4f53\u601d\u8def<\/h2>\n\n\n\n<p>\u5728\u201c\u8054\u7f51\u673a\u201d\u4e0a\u4e0b\u8f7d\u597d\u6240\u6709.deb\u5305\uff08\u5305\u542b\u5b8c\u6574\u4f9d\u8d56\uff09\uff0c\u6253\u5305\u540e\u901a\u8fc7 HTTP \u5206\u4eab\uff0c\u53e6\u4e00\u53f0\u79bb\u7ebf\u673a\u5668\u4f7f\u7528\u811a\u672c\u4e0b\u8f7d\u3001\u89e3\u538b\u5e76\u5b89\u88c5\u8fd9\u4e9b.deb\u5305\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u201c\u8054\u7f51\u673a\u201d\u51c6\u5907\u79bb\u7ebf\u5305<\/h2>\n\n\n\n<p>\u5b89\u88c5\u6240\u9700\u8f6f\u4ef6\uff08\u4f1a\u81ea\u52a8\u7f13\u5b58 .deb\uff09<br><kbd>sudo apt update<br>sudo apt install ubuntu-desktop-minimal firefox<\/kbd><\/p>\n\n\n\n<p>\u68c0\u67e5.deb\u5305\u662f\u5426\u7f13\u5b58<br><kbd>ls -l \/var\/cache\/apt\/archives\/<\/kbd><\/p>\n\n\n\n<p>\u628a\u8fd9\u4e9b.deb\u5305\u590d\u5236\u5e76\u6253\u5305<\/p>\n\n\n\n<p><kbd>mkdir -p ~\/offline-debs<br>cp \/var\/cache\/apt\/archives\/*.deb ~\/offline-debs\/<br>cd ~<br>tar -czf offline-debs.tar.gz offline-debs\/<\/kbd><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u201c\u8054\u7f51\u673a\u201d\u51c6\u5907\u5b89\u88c5\u811a\u672c<\/h2>\n\n\n\n<p>\u7f16\u5199\u5b89\u88c5\u811a\u672c <code>install.sh<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nset -e\n\n# Step 1: \u4e0b\u8f7d\u5e76\u89e3\u538b\nURL=\"http:\/\/192.168.31.47:8080\/offline-debs.tar.gz\"\nTAR_FILE=\"\/tmp\/offline-debs.tar.gz\"\nDEST_DIR=\"\/tmp\/offline-debs\"\n\necho \"Downloading package archive...\"\nwget -O \"$TAR_FILE\" \"$URL\"\n\necho \"Extracting to $DEST_DIR...\"\nrm -rf \"$DEST_DIR\"\nmkdir -p \"$DEST_DIR\"\ntar -xzf \"$TAR_FILE\" -C \"$DEST_DIR\"\n\nDEB_DIR=$(find \"$DEST_DIR\" -type d -name \"offline-debs\" | head -n 1)\nif &#91;&#91; -z \"$DEB_DIR\" ]]; then\n    echo \"Error: .deb directory not found.\"\n    exit 1\nfi\n\n# Step 2: \u5199\u5165\u4e34\u65f6 TUNA \u6e90\uff08\u4e0d\u5f71\u54cd\u4e3b\u914d\u7f6e\uff09\necho \"Adding temporary TUNA source...\"\ncat &lt;&lt;EOF | sudo tee \/etc\/apt\/sources.list.d\/temp-tuna.sources > \/dev\/null\nTypes: deb\nURIs: https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\nSuites: noble noble-updates noble-backports\nComponents: main restricted universe multiverse\nSigned-By: \/usr\/share\/keyrings\/ubuntu-archive-keyring.gpg\nEOF\n\n# Step 3: \u66f4\u65b0 apt \u7f13\u5b58\necho \"Running apt update...\"\nsudo apt update\n\n# Step 4: \u5b89\u88c5\necho \"Installing packages from local .deb and remote source if needed...\"\ncd \/tmp\/offline-debs\/offline-debs\/\nsudo apt install -y .\/*.deb\nsudo apt install -y ubuntu-desktop-minimal\n\n# Step 5: \u6e05\u7406\u4e34\u65f6\u6e90\necho \"Cleaning up temporary source...\"\nsudo rm \/etc\/apt\/sources.list.d\/temp-tuna.sources\nsudo apt update\n\n# Step 6: \u8bbe\u7f6e\u684c\u9762\u4e3a\u9ed8\u8ba4\necho \"Setting Graphicall desktop as default\"\nsystemctl set-default graphical.target\n\necho \"Installation complete.\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u51c6\u5907HTTP\u6587\u4ef6\u670d\u52a1\u5668<\/h2>\n\n\n\n<p>\u5c06\u4ee5\u4e0a\u7684offline-debs.tar.gz\u6587\u4ef6\u5305\u548cinstall.sh\u811a\u672c\u653e\u5728\u5408\u9002\u7684\u76ee\u5f55\u4e0b\uff0c\u5e76\u5728\u6b64\u5904\u8fd0\u884c<br><kbd>python3 -m http.server 8080<\/kbd><\/p>\n\n\n\n<p>\u5728\u201c\u79bb\u7ebf\u673a\u201d\u4e0a\u83b7\u53d6\u811a\u672c\u5e76\u5b89\u88c5<br><kbd>wget http:\/\/192.168.31.47:8080\/install.sh<br>bash install.sh<\/kbd><\/p>\n\n\n\n<p>\u7b49\u5f85\u811a\u672c\u8fd0\u884c\u5b8c\u6210\u540e\uff0c\u5982\u679c\u5e0c\u671b\u5f00\u673a\u9ed8\u8ba4\u8fdb\u5165\u684c\u9762\u73af\u5883\uff0c\u9700\u8981\u6267\u884c<br><kbd>systemctl set-default graphical.target<\/kbd><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u4e8e\u6211\u53ef\u80fd\u8981\u6279\u91cf\u5b89\u88c5\u4e00\u6279\u8fb9\u7f18\u76d2\u5b50\uff0c\u6240\u4ee5\uff0c\u6211\u5e0c\u671b\u5728\u81ea\u52a8\u5316\u5b89\u88c5\u7cfb\u7edf\u540e\uff0c\u5c3d\u91cf\u901a\u8fc7\u79bb\u7ebf.deb\u5305\u7684\u5f62\u5f0f\u5b89\u88c5\u684c\u9762\u73af\u5883\uff08u [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-574","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts\/574"}],"collection":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=574"}],"version-history":[{"count":2,"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts\/574\/revisions"}],"predecessor-version":[{"id":576,"href":"https:\/\/windywind.tk\/index.php?rest_route=\/wp\/v2\/posts\/574\/revisions\/576"}],"wp:attachment":[{"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windywind.tk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}