{"id":13586,"date":"2025-12-12T21:00:59","date_gmt":"2025-12-12T13:00:59","guid":{"rendered":"https:\/\/www.ldhost.cn\/jc\/?p=13586"},"modified":"2025-12-12T21:01:29","modified_gmt":"2025-12-12T13:01:29","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%b3%bb%e7%bb%9f%e5%a6%82%e4%bd%95%e4%bb%8e-ubuntu-20-04-%e5%8d%87%e7%ba%a7%e5%88%b0-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/www.ldhost.cn\/jc\/linux\/13586.html","title":{"rendered":"\u670d\u52a1\u5668\u7cfb\u7edf\u5982\u4f55\u4ece Ubuntu 20.04 \u5347\u7ea7\u5230 Ubuntu 22.04"},"content":{"rendered":"\n<p>Ubuntu 22.04 LTS Jammy Jellyfish \u662f Ubuntu \u7684\u6700\u65b0\u7248\u672c\uff0c\u4e8e 2022 \u5e74 4 \u6708 21 \u65e5\u53d1\u5e03\u3002\u5b83\u662f\u7ee7 Ubuntu 20.04 LTS \u4e4b\u540e\u6700\u65b0\u7684\u957f\u671f\u652f\u6301 (LTS) \u7248\u672c\u3002Ubuntu 22.04 \u662f\u4e16\u754c\u4e0a\u6700\u53d7\u6b22\u8fce\u7684 Linux \u53d1\u884c\u7248\u4e4b\u4e00\u3002\u4f5c\u4e3a\u957f\u671f\u652f\u6301\u7248\u672c\uff0cUbuntu 22.04 LTS \u5c06\u83b7\u5f97\u957f\u8fbe 10 \u5e74\u7684\u652f\u6301\u3002<\/p>\n\n\n\n<p>\u5728\u8fdb\u884c\u5347\u7ea7\u4e4b\u524d\uff0c\u8bf7\u52a1\u5fc5\u5c06<a href=\"https:\/\/www.ldhost.cn\/cloudhost.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u670d\u52a1\u5668<\/a>\u4e0a\u6240\u6709\u91cd\u8981\u6570\u636e\u5907\u4efd\u5230\u672c\u5730\u786c\u76d8\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>latest Ubuntu release<\/code>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u548c\u5347\u7ea7\u6574\u4e2a\u7cfb\u7edf\u3002<code># apt update -y &amp;&amp; apt upgrade -y <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_1.png\" alt=\"ubuntuupdate20to22_1\"><br>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u60a8\u9009\u62e9\u4ee5\u4e0b\u9009\u9879\uff0c\u8bf7\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u9009\u62e9<code>keep the local version currently installed<\/code>\u5e76\u6267\u884c<code>reboot<\/code>\u76f8\u5e94\u64cd\u4f5c\u3002<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_2.png\" alt=\"ubuntuupdate20to22_2\"><\/li>\n<\/ol>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u68c0\u67e5\u4e00\u4e0b<code>installed release<\/code>\u3002<code># cat \/etc\/os-release <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_3.png\" alt=\"ubuntuupdate20to22_3\"><\/li>\n\n\n\n<li>\u7531\u4e8e<a href=\"https:\/\/www.ldhost.cn\/hkserver.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u670d\u52a1\u5668<\/a>\u5f53\u524d\u4f7f\u7528\u7684\u662f SSH \u7aef\u53e3 22\uff0c\u8bf7\u9009\u62e9\u53e6\u4e00\u4e2a\u7aef\u53e3<code>free port<\/code>\u8fdb\u884c\u8fde\u63a5\u4ee5\u66f4\u65b0\u670d\u52a1\u5668\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u7aef\u53e3 1022\u3002<br>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5141\u8bb8\u7aef\u53e3 1022\/TCP\uff1a<code># ufw allow 1022\/TCP # ufw reload # ufw status <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_4.png\" alt=\"ubuntuupdate20to22_4\"><\/li>\n\n\n\n<li>\u5b89\u88c5<code>update-manger-core<\/code>\u3002<code># apt install update-manager-core <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_5.png\" alt=\"ubuntuupdate20to22_5\"><\/li>\n\n\n\n<li>\u7acb\u5373\u5f00\u59cb\u66f4\u65b0<code>ubuntu 22<\/code>\u3002<code># do-release-upgrade -d <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_6.png\" alt=\"ubuntuupdate20to22_6\"><br>\u5b83\u4f1a\u68c0\u6d4b SSH \u8fde\u63a5\uff0c\u5e76\u901a\u77e5\u60a8\u5c06\u5728 1022 \u7aef\u53e3\u542f\u52a8\u989d\u5916\u7684 SSH \u670d\u52a1\u3002\u53ea\u9700\u8f93\u5165<code>Y<\/code>\u5e76\u6309<code>ENTER<\/code>\u5373\u53ef\u7ee7\u7eed\u3002<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_7.png\" alt=\"ubuntuupdate20to22_7\"><br>\u5982\u679c\u9ed8\u8ba4\u7aef\u53e3\u4e0a\u7684 SSH \u8fde\u63a5\u4e2d\u65ad\uff0c\u5347\u7ea7\u5de5\u5177\u5c06\u901a\u77e5\u60a8\u4f7f\u7528\u5907\u7528 SSH \u7aef\u53e3 1022\u3002\u7531\u4e8e\u8be5\u7aef\u53e3\u5df2\u6253\u5f00\uff0c\u8bf7\u6309<code>ENTER<\/code>\u3002<br><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_8.png\" alt=\"ubuntuupdate20to22_8\"><\/li>\n\n\n\n<li>\u66f4\u65b0\u5de5\u5177\u5c06\u8ba1\u7b97\u6240\u6709\u66f4\u6539\u5e76\u63d0\u4f9b\u6458\u8981\u3002<br>\u8981\u7ee7\u7eed\uff0c\u8bf7\u518d\u6b21\u6309\u4e0b<code>Y<\/code>\u5e76\u6309\u4e0b<code>ENTER<\/code>\u3002<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_9.png\" alt=\"ubuntuupdate20to22_9\"><br>\u67d0\u4e9b\u670d\u52a1\u9700\u8981\u91cd\u542f\uff0c<code>Yes<\/code>\u5728\u8f6f\u4ef6\u5305\u5347\u7ea7\u671f\u95f4\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5728\u4e0d\u63d0\u793a\u7684\u60c5\u51b5\u4e0b\u91cd\u542f\u8fd9\u4e9b\u670d\u52a1\u3002\u00a0<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_10.png\" alt=\"ubuntuupdate20to22_10\"><\/li>\n\n\n\n<li>\u5f53\u7cfb\u7edf\u63d0\u793a\u201c<strong>\u60a8\u60f3\u5bf9\u5df2\u4fee\u6539\u7684\u914d\u7f6e\u6587\u4ef6 sshd_config \u6267\u884c\u4ec0\u4e48\u64cd\u4f5c\uff1f\u201d<\/strong>\u65f6\uff0c\u8bf7\u9009\u62e9<code>keep the local version currently installed<\/code>\u3002<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_11.png\" alt=\"ubuntuupdate20to22_11\"><\/li>\n\n\n\n<li>\u6309\u4e0b<code>Y<\/code>\u5e76\u70b9\u51fb<code>ENTER<\/code>\u5373\u53ef\u79fb\u9664\u8fc7\u65f6\u7684\u8f6f\u4ef6\u5305\u3002<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_12.png\" alt=\"ubuntuupdate20to22_12\"><\/li>\n\n\n\n<li>\u5347\u7ea7\u5b8c\u6210\u540e\uff0c\u91cd\u542f\u7cfb\u7edf\u4ee5\u5b8c\u6210\u5347\u7ea7\u3002\u6309\u4e0b<code>Y<\/code>\u5e76\u70b9\u51fb<code>ENTER<\/code>\u91cd\u542f\u6309\u94ae\u3002<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_13.png\" alt=\"ubuntuupdate20to22_13\"><\/li>\n\n\n\n<li>\u91cd\u542f\u540e\u68c0\u67e5\u4e00\u4e0b<code>OS information<\/code>\u3002<code># cat \/etc\/os-release <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_14.png\" alt=\"ubuntuupdate20to22_14\"><\/li>\n\n\n\n<li>\u5220\u9664<code>ufw firewall rules<\/code>\u3002<code># ufw delete allow 1022\/TCP <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_15.png\" alt=\"ubuntuupdate20to22_15\"><\/li>\n\n\n\n<li><code>disk space<\/code>\u5220\u9664\u6240\u6709\u4e0d\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\uff0c\u91ca\u653e\u7a7a\u95f4\u3002<code># sudo apt autoremove --purge <\/code><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/jc\/wp-content\/uploads\/2025\/12\/ubuntuupdate20to22_16.png\" alt=\"ubuntuupdate20to22_16\"><\/li>\n<\/ol>\n<div><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/images\/ad-845-3.png\" alt=\"\u56fe\u7247\u63cf\u8ff0\" \/><\/div>","protected":false},"excerpt":{"rendered":"<p>Ubuntu 22.04 LTS Jammy Jellyfish \u662f Ubuntu \u7684\u6700\u65b0\u7248\u672c\uff0c\u4e8e 2022 \u5e74 4 \u6708 21 \u65e5\u53d1\u5e03\u3002\u5b83\u662f\u7ee7 Ubuntu 20.04 LTS \u4e4b\u540e\u6700\u65b0\u7684\u957f\u671f\u652f\u6301 (LTS) \u7248\u672c\u3002Ubuntu 22.04 \u662f\u4e16\u754c\u4e0a\u6700\u53d7\u6b22\u8fce\u7684 Linux \u53d1\u884c\u7248\u4e4b\u4e00\u3002\u4f5c\u4e3a\u957f\u671f\u652f\u6301\u7248\u672c\uff0cUbuntu 22.04 LTS \u5c06\u83b7\u5f97\u957f\u8fbe 10 \u5e74\u7684\u652f\u6301\u3002 \u5728\u8fdb\u884c\u5347\u7ea7\u4e4b\u524d\uff0c\u8bf7\u52a1\u5fc5\u5c06\u670d\u52a1\u5668\u4e0a\u6240\u6709\u91cd\u8981\u6570\u636e\u5907\u4efd\u5230\u672c\u5730\u786c\u76d8\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[96],"tags":[],"class_list":["post-13586","post","type-post","status-publish","format-standard","hentry","category-linux","content-layout-excerpt-thumb"],"_links":{"self":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/13586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/comments?post=13586"}],"version-history":[{"count":1,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/13586\/revisions"}],"predecessor-version":[{"id":13603,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/13586\/revisions\/13603"}],"wp:attachment":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/media?parent=13586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/categories?post=13586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/tags?post=13586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}