最新公告

×
<body style="font-family: Arial, sans-serif; line-height: 1.6; padding: 20px; max-width: 800px; margin: 0 auto;"> <h2 style="color: #ff0000; font-weight: bold; font-size: 24px;">最新通知</h2> <h2 style="color: #333; padding-bottom: 8px; margin-top: 30px; font-size: 22px;">双十二活动</h2> <ul style="list-style-type: disc; margin-left: 20px; padding-left: 10px;"> <li style="margin-bottom: 10px; color: #e63946; font-weight: bold; font-size: 18px;"> 性价比服务器(续费同价,数量有限,先抢先得): </li> <li style="margin-bottom: 10px;">美国2H2G 特价 月付仅9.9元</li> <li style="margin-bottom: 10px;">深圳4H4G电信线路特价 月付仅19元</li> <li style="margin-bottom: 10px;">香港2H2G CTG线路特价 月付仅15元</li> <li style="margin-bottom: 10px;"> 活动地址:<a href="http://cs.tydidc.cn/actcloud.html" target="_blank" style="color: #0066cc; text-decoration: none;"> 点击跳转到活动页面 </a> </li> </ul> </body>
文档首页> 教程> debian11更新到debian12

debian11更新到debian12

发布时间:2025-08-20 07:11        更新时间:2025-08-20 07:20
要将 Debian 11(Bullseye)更新到 Debian 12(Bookworm),可以按照以下步骤进行操作:

1. 准备工作

首先确保系统处于最新状态并安装必要工具:
# 更新现有系统
sudo apt update && sudo apt upgrade -y
# 安装升级所需工具
sudo apt install -y apt-listchanges
 
# 清理不需要的包
sudo apt autoremove -y
sudo apt autoclean
 

2. 备份重要数据

 
在进行系统升级前,建议备份重要数据和配置文件,例如:
 
# 备份/etc目录(系统配置)
sudo tar -czvf /backup/etc_backup_$(date +%F).tar.gz /etc

# 备份用户数据(根据实际情况调整)
sudo tar -czvf /backup/home_backup_$(date +%F).tar.gz /home

3. 修改软件源

 
将软件源从 Bullseye 替换为 Bookworm:
 
# 备份原有源文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp -r /etc/apt/sources.list.d/ /etc/apt/sources.list.d.bak

# 替换源中的bullseye为bookworm
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list

# 对于security源,也需要更新
sudo sed -i 's/bullseye-security/bookworm-security/g' /etc/apt/sources.list
 

4. 执行系统升级

 
# 更新软件包列表
sudo apt update

# 先进行最小化升级
sudo apt upgrade --without-new-pkgs -y

# 执行完整升级
sudo apt full-upgrade -y
在升级过程中,会出现一些配置文件替换的提示,你可以根据需要选择:
 

按 N 保留当前配置

按 Y 替换为新配

按 D 查看两者差异

5. 清理系统

升级完成后,清理不再需要的包:
sudo apt autoremove -y
sudo apt autoclean

6. 验证系统版本

重启系统后,验证是否成功升级到 Debian 12:
sudo reboot

# 重启后检查版本
lsb_release -a