如何从 Debian 10 升级到 Debian 11如何从 Debian 10 升级到 Debian 11如何从 Debian 10 升级到 Debian 11如何从 Debian 10 升级到 Debian 11
  • 文章
  • 正则表达式
    • 工具
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容
发表 admin at 2025年2月28日
类别
  • 未分类
标签

如何从 Debian 10 升级到 Debian 11

本教程适用于这些操作系统版本

  • Debian 10(Buster)
  • Debian 6(Squeeze)

在此页

  1. 先决条件
  2. 更新系统
  3. 使用 Debian 11 更新 Debian 10 存储库
  4. 将 Debian 10 升级到 Debian 11
  5. 验证 Debian 11 升级
  6. 结论

Debian 11,代号“Bullseye”,于 2021 年 8 月 14 日发布。它是一个稳定的版本,并在未来 5 年内得到支持。此版本带来了许多知名软件包的更新,包括 Linux Kernel 5.10 LTS、Apache 2.4.48、MariaDB 10.5、Python 3.9.1、PostgreSQL 13 等。

在升级到 Debian 11 之前,您应该做以下事情:

  • 备份外部驱动器上的所有文件。
  • 确保您的互联网连接稳定。
  • 禁用任何外部存储库。

在本文中,我将向您展示如何通过几个简单的步骤从 Debian 10 升级到新的 Debian 11。

先决条件

  • 运行 Debian 10 的服务器。
  • 在服务器上配置了根密码。

更新系统

首先,您必须将所有系统软件包更新并升级到最新版本。运行以下命令更新和升级所有包:

apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y

接下来,使用以下命令删除所有不需要的包:

apt-get autoremove

接下来,使用以下命令清理 APT 包缓存:

apt-get clean

接下来,重新启动系统以应用所有更新:

reboot

重新启动系统后,使用以下命令验证您的操作系统版本:

lsb_release -a

您应该看到以下输出:

No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

使用 Debian 11 更新 Debian 10 存储库

接下来,您需要使用 Debian 11 更新 Debian 10 存储库以下载和接收更新。

为此,您可以通过运行以下命令来更新所有源文件:

sed -i 's/buster\/updates/bullseye-security/g' /etc/apt/sources.list
sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sed -i 's/buster\/updates/bullseye-security/g' /etc/apt/sources.list.d/*.list
sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list

或者使用以下命令手动编辑 APT 源文件:

nano /etc/apt/sources.list

将 \buster/updates\ 替换为 \bullseye-security\,将 \buster\ 替换为 \bullseye\。结果应该类似于下面的结果:

deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free

如果 /etc/apt/sources.list.d/ 中有更多 APT 源文件,请在完成后保存并关闭文件,同时通过将 \buster\ 替换为 \bullseye\ 来编辑这些文件。

将 Debian 10 升级到 Debian 11

此时,您的 Debian 10 服务器已准备好升级。

首先,更新存储库以应用您在上一步中所做的更改。

apt-get update -y

现在我们将更新现有包而不安装新包:

apt upgrade --without-new-pkgs -y

更新存储库后,运行以下命令开始升级:

apt-get full-upgrade -y

系统升级后,重新启动它以应用所有更新。

reboot

验证 Debian 11 升级

此时,您的 Debian 10 服务器已升级到 Debian 11。您现在可以使用以下命令对其进行验证:

lsb_release -a

您应该在以下输出中看到 Debian 11 版本:

No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

结论

在上面的指南中,我们解释了如何从 Debian 10 升级到 Debian 11。我希望你现在可以毫不费力地升级你的 Debian 10。

©2015-2025 艾丽卡 support@alaica.com