From 7988fe336261376d8679f1e9fe6d5cb7b729b47b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 13 Jun 2023 09:58:58 +0800 Subject: [PATCH] ATRP @wxy https://linux.cn/article-15902-1.html --- ...️ How to Upgrade to Debian 12 from Debian 11.md | 199 ++++++++++++++++++ ...️ How to Upgrade to Debian 12 from Debian 11.md | 195 ----------------- 2 files changed, 199 insertions(+), 195 deletions(-) create mode 100644 published/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md delete mode 100644 sources/tech/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md diff --git a/published/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md b/published/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md new file mode 100644 index 0000000000..0928de52e9 --- /dev/null +++ b/published/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md @@ -0,0 +1,199 @@ +[#]: subject: "How to Upgrade to Debian 12 from Debian 11" +[#]: via: "https://www.debugpoint.com/upgrade-debian-12-from-debian-11/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "ChatGPT" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15902-1.html" + +从 Debian 11 升级到 Debian 12 +====== + +![][0] + +> 以下是如何从 Debian 11 升级到 Debian 12 “Bookworm” 的步骤。 + +Debian 12 Bookworm 已经发布。如果你正在运行 Debian 11 “Bullseye”,你可以计划现在升级你的台式机或服务器。但是,建议你等待 Debian “Bookworm” 的第一个小版本,即 12.1 版本,再进行关键服务器升级。 + +话虽如此,如果你想了解 Debian 12 的新特性,可以查看 [这篇文章][1]。以下是详细的升级步骤: + +### 从 Debian 11 升级到 Debian 12 + +无论你运行的是 Debian 服务器还是任何桌面版本,请确保备份关键数据。例如,你可能需要为桌面文档进行备份。如果是服务器,请记录正在运行的服务。你可以使用 `rsync` 或其他实用工具来完成此操作。 + +Debian 12 引入了一个名为 `non-free-firmware` 的新仓库,用于专有驱动程序和软件包。如果你使用任何“闭源”的网络、显示、图形或其他驱动程序,你可能需要在升级后进行配置。 + +对于网络驱动程序,请确保在某个地方安全地记录 `/etc/network/interfaces` 和 `/etc/resolv.conf` 文件的内容。如果在升级完成后失去了网络连接,可以 [按照这个指南][2] 轻松设置它。 + +从命令提示符运行以下命令,以确保 Debian 11 更新了安全和其他软件包: + +``` +sudo apt update +sudo apt upgrade +sudo apt full-upgrade +sudo apt autoremove +``` + +完成上述命令后,重新启动 Debian 11 系统: + +``` +sudo systemctl reboot +``` + +记下关于 Debian 11 的几个信息。这对于服务器很重要。它们包括内核版本和 Debian 版本。这是因为升级后,你可以验证下面的相同命令以确保升级成功。 + +例如,我尝试升级的系统是 Debian 11.7,内核版本为 5.10。 + +``` +uname -mr +``` + +示例输出: + +``` +5.10.0-23-amd64 x86_64 +``` + +``` +cat /etc/debian_version +``` + +示例输出: + +``` +11.7 +``` + +将 APT 源文件备份到你选择的任何目录: + +``` +sudo cp -v /etc/apt/sources.list /home/arindam/ +sudo cp -vr /etc/apt/sources.list.d/ /home/arindam/ +``` + +打开 `/etc/apt/sources.list` 文件,并将 Debian 12 的代号 `bookworm` 添加到该文件中,替换 `bullseye`。 + +``` +sudo nano /etc/apt/sources.list +``` + +以下是我测试系统中的 `/etc/apt/sources.list` 文件**更改之前**的内容作为参考: + +``` +deb http://deb.debian.org/debian/ bullseye main +deb-src http://deb.debian.org/debian/ bullseye main + +deb http://security.debian.org/debian-security bullseye-security main +deb-src http://security.debian.org/debian-security bullseye-security main + +deb http://deb.debian.org/debian/ bullseye-updates main +deb-src http://deb.debian.org/debian/ bullseye-updates main +``` + +以下是**更改后**的 `/etc/apt/sources.list` 文件。以下镜像网址是默认设置。如果你使用不同的 Debian 镜像,请不要更改它们: + +``` +deb http://deb.debian.org/debian/ bookworm main +deb-src http://deb.debian.org/debian/ bookworm main + +deb http://security.debian.org/debian-security bookworm-security main +deb-src http://security.debian.org/debian-security bookworm-security main + +deb http://deb.debian.org/debian/ bookworm-updates main +deb-src http://deb.debian.org/debian/ bookworm-updates main + +deb http://deb.debian.org/debian bookworm non-free non-free-firmware +deb-src http://deb.debian.org/debian bookworm non-free non-free-firmware + +deb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware +deb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware + +deb http://deb.debian.org/debian bookworm-updates non-free non-free-firmware +deb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware +``` + +![更新源文件][3] + +**注意**:从 Debian 12 “Bookworm” 开始,Debian 团队创建了一个新的仓库 `non-free-firmware` 来打包非自由的软件包。因此,在上面的示例中最后三个部分中也包含了它们。 + +保存文件并退出。 + +打开终端并运行以下命令以开始升级过程: + +``` +sudo apt update +sudo apt full-upgrade +``` + +![升级过程][4] + +![Debian 12 升级过程进行中][5] + +在升级过程中,安装程序可能会要求你重新启动几个服务。仔细阅读消息后点击 “Yes”。另外,如果你看到带有 `:` 的提示,请按 `q` 键退出该消息。 + +![确认服务验证][6] + +等待软件包下载和安装完成。 + +升级完成后,请重新启动你的 Debian 桌面或服务器: + +``` +sudo systemctl reboot +``` + +### 检查升级状态 + +重启后,请验证你是否正在运行 Debian 12。可以使用以下文件检查 Debian 版本: + +``` +cat /etc/debian_version +``` + +示例输出: + +![Debian 12 Bookworm Desktop (Xfce)][7] + +此外,如果你刚刚升级到 Debian 12 服务器,请确保验证正在运行的服务,例如 HTTP、SSH 等。你可以使用以下 [systemd 命令][8] 了解正在运行的服务: + +``` +systemctl list-units --type=service +``` + +### 总结和清理 + +在确认所有步骤都已完成后,你可能希望运行 `apt autoremove` 命令来清理不需要的软件包。但是,请在执行此操作时格外小心。 + +``` +sudo apt --purge autoremove +``` + +这就是升级到 Debian 12 的简要步骤。希望你的升级顺利进行。如果你正在关键服务器上运行 Debian 11,请勿立即升级,请等到 Debian 12.1 发布。 + +有关 Debian 升级的更多信息,请访问 [官方文档][9]。 + +最后,请别忘了告诉我们你的升级情况。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/upgrade-debian-12-from-debian-11/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:ChatGPT +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://linux.cn/article-15776-1.html +[2]: https://wiki.debian.org/NetworkConfiguration +[3]: https://www.debugpoint.com/wp-content/uploads/2023/06/updating-sources-file.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2023/06/Upgrade-process-1.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/06/Debian-12-Upgrade-process-in-progress.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2023/06/Confirmation-about-service-verifications.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2023/06/Debian-12-Bookworm-Desktop-Xfce.jpg +[8]: https://www.debugpoint.com/systemd-systemctl-service/ +[9]: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.en.html +[0]: https://img.linux.net.cn/data/attachment/album/202306/13/095427caykwtqw8fay944z.jpg \ No newline at end of file diff --git a/sources/tech/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md b/sources/tech/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md deleted file mode 100644 index 3f7d825f5a..0000000000 --- a/sources/tech/20230610.1 ⭐️⭐️ How to Upgrade to Debian 12 from Debian 11.md +++ /dev/null @@ -1,195 +0,0 @@ -[#]: subject: "How to Upgrade to Debian 12 from Debian 11" -[#]: via: "https://www.debugpoint.com/upgrade-debian-12-from-debian-11/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Upgrade to Debian 12 from Debian 11 -====== - -**Here’s how you can upgrade to Debian 12 “Bookworm” from Debian 11 “Bullseye”.** - -Debian 12 Bookworm is releasing shortly. If you are running Debian 11 Bullseye, you can plan to upgrade your desktop or server now. However, it is recommended that you wait until the first point release, i.e. 12.1 of Debian Bookworm, for critical server upgrades. - -That said if you want to check out the cool features of Debian 12, check [out this article][1]. Here are the detailed steps to upgrade. - -### Upgrade to Debian 12 from Debian 11 - -- Whether you are running a Debian server or any desktop version, make sure to take backups of critical data. For example, you might want to take backups of your documents for a desktop. If it is a server, keep a note of the services you are running. You can use rsync or any other utilities to do that. - -- Debian 12 is introducing a new repo, “non-free-firmware”, for proprietary drivers and packages. If you are using any “closed-source” network, display, graphics or any other drivers, you may need to configure them after the upgrade. - -- For network drivers, make sure to note down the content of the `/etc/network/interfaces` and `/etc/resolv.conf` files somewhere safe. If you lose network connection after the upgrade is complete, you can set it up easily by [following this guide][2]. - -- From the command prompt, run the following command to make sure Debian 11 is up to date with security and other packages. - -``` -sudo apt update -sudo apt upgrade -sudo apt full-upgrade -sudo apt autoremove -``` - -- Once the above commands are complete, reboot the Debian 11 system. - -``` -sudo systemctl reboot -``` - -- Note down a few pieces of information about Debian 11. This is important for servers. These include the Kernel version and the Debian version. The reason is you can verify the same commands below after the upgrade whether the upgrade is successful. -- For example, the system I am trying to upgrade is Debian 11.7, and Kernel is 5.10. - -``` -uname -mr -``` - -Example output: - -``` -5.10.0-23-amd64 x86_64 -``` - -``` -cat /etc/debian_version -``` - -Example output: - -``` -11.7 -``` - -- Take backups of the APT source file to any directory of your choice. - -``` -sudo cp -v /etc/apt/sources.list /home/arindam/ -sudo cp -vr /etc/apt/sources.list.d/ /home/arindam/ -``` - -- Open the `/etc/apt/sources.list` file and add the Debian 12 “`bookworm`” code name by replacing “`bullseye`“. - -``` -sudo nano /etc/apt/sources.list -``` - -- Here’s the file **before the changes** in my test system for your reference. - -``` -deb http://deb.debian.org/debian/ bullseye main -deb-src http://deb.debian.org/debian/ bullseye main - -deb http://security.debian.org/debian-security bullseye-security main -deb-src http://security.debian.org/debian-security bullseye-security main - -deb http://deb.debian.org/debian/ bullseye-updates main -deb-src http://deb.debian.org/debian/ bullseye-updates main -``` - -- Here’s the file **after the changes**. The mirror URLs below are for default settings. If you are using a different Debian mirror, keep those unchanged. - -``` -deb http://deb.debian.org/debian/ bookworm main -deb-src http://deb.debian.org/debian/ bookworm main - -deb http://security.debian.org/debian-security bookworm-security main -deb-src http://security.debian.org/debian-security bookworm-security main - -deb http://deb.debian.org/debian/ bookworm-updates main -deb-src http://deb.debian.org/debian/ bookworm-updates main - -deb http://deb.debian.org/debian bookworm non-free non-free-firmware -deb-src http://deb.debian.org/debian bookworm non-free non-free-firmware - -deb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware -deb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware - -deb http://deb.debian.org/debian bookworm-updates non-free non-free-firmware -deb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware -``` - -![updating sources file][3] - -**Note**: From Debian 12 Bookworm onwards, the Debian team created a new repo `non-free-firmware`, to package the non-free packages. Hence, the last three sections included the same in the above example. - -- Save the file and exit. - -- Open the terminal and run the following command to start the upgrade process. - -``` -sudo apt update -sudo apt full-upgrade -``` - -![Upgrade process -1][4] - -![Debian 12 Upgrade process in progress][5] - -- During the upgrade, the installer might ask you about several services being restarted. Hit yes after carefully reading the messages. Also, if you see any prompts with `":"`, hit `"q"` to quit the message. - -![Confirmation about service verifications][6] - -- Wait for the download and installation of the packages. - -- After the upgrade is complete, reboot your Debian desktop or server. - -``` -sudo systemctl reboot -``` - -### Check the upgrade status - -After reboot, verify whether you are running Debian 12. You can check the Debian version using the following file. - -``` -cat /etc/debian_version -``` - -Example output: - -![Debian 12 Bookworm Desktop (Xfce)][7] - -- Also, if you have just upgraded to a Debian 12 server, make sure to verify services running, such as HTTP, ssh and so on. You can use the below [systemd command][8] to learn about the services running. - -``` -systemctl list-units --type=service -``` - -### Conclusion and cleaning up - -After you verified all the steps are complete, you may want to run apt autoremove to clean up unwanted packages. But be careful while doing it. - -``` -sudo apt --purge autoremove -``` - -So, that’s the brief set of steps to upgrade to Debian 12. I hope your upgrade goes smoothly. If you are running Debian 11 on a critical server, do not upgrade now. Wait for the Debian 12.1 release. - -For more information about the Debian upgrade, visit the [official documentation][9]. - -Finally, don’t forget to let us know how your upgrade went. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/upgrade-debian-12-from-debian-11/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed/ -[1]: https://www.debugpoint.com/debian-12-features/ -[2]: https://wiki.debian.org/NetworkConfiguration -[3]: https://www.debugpoint.com/wp-content/uploads/2023/06/updating-sources-file.jpg -[4]: https://www.debugpoint.com/wp-content/uploads/2023/06/Upgrade-process-1.jpg -[5]: https://www.debugpoint.com/wp-content/uploads/2023/06/Debian-12-Upgrade-process-in-progress.jpg -[6]: https://www.debugpoint.com/wp-content/uploads/2023/06/Confirmation-about-service-verifications.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2023/06/Debian-12-Bookworm-Desktop-Xfce.jpg -[8]: https://www.debugpoint.com/systemd-systemctl-service/ -[9]: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.en.html \ No newline at end of file