设为首页
收藏本站
切换到宽版
首页
BBS
最新文章
项目推荐(站长实测)
获取网赚项目&精品源码
登录
立即注册
52线报网
»
首页
›
我爱线报
›
自学教程
›
Debian 11 升级至 Debian 12 的完整实战指南
返回列表
发布新帖
查看:
3
|
回复:
0
Debian 11 升级至 Debian 12 的完整实战指南
葫芦勇闯天涯
葫芦勇闯天涯
当前离线
积分
617
205
主题
0
回帖
617
积分
高级会员
高级会员, 积分 617, 距离下一级还需 383 积分
高级会员, 积分 617, 距离下一级还需 383 积分
积分
617
发消息
发表于
昨天 17:48
|
查看全部
|
阅读模式
想让你的 Debian 11 (Bullseye) 升级到 Debian 12 (Bookworm)?这篇教程简单直接,带你完成整个过程。跟着步骤走,轻松升级!
---
准备工作
1. 备份数据
升级前备份重要文件。用下面命令备份到外部设备:
sudo rsync -av /home/user /mnt/backup
或者打包整个系统:
sudo tar -cvpzf /mnt/backup/debian11-backup.tar.gz --exclude=/proc --exclude=/sys /
2. 检查系统
确认当前是 Debian 11:
lsb_release -a
检查磁盘空间(建议 10GB 以上):
df -h
3. 更新 Debian 11
确保系统是最新的:
sudo apt update && sudo apt full-upgrade -y
清理无用包:
sudo apt autoremove && sudo apt autoclean
4. 重启检查
重启系统,确保没问题:
sudo reboot
升级步骤
1. 修改软件源
编辑文件:
sudo nano /etc/apt/sources.list
把 “bullseye“ 改成 “bookworm“。改完像这样:
deb
http://deb.debian.org/debian
bookworm main contrib non-free
deb
http://deb.debian.org/debian-security
bookworm-security main contrib non-free
保存退出(Ctrl+O,Enter,Ctrl+X)。
2. 更新包索引
运行:
sudo apt update
如果有密钥错误,按提示导入:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <密钥ID>
3. 小范围升级
先更新现有包:
sudo apt upgrade --without-new-pkgs
4. 完整升级
升级到 Debian 12:
sudo apt full-upgrade
提示时按 Y 确认,可能需要移除旧包。
5. 重启系统
升级完重启:
sudo reboot
---
升级后检查
1. 确认版本
检查是否变成 Debian 12:
lsb_release -a
2. 检查服务
确保服务正常,比如 SSH:
sudo systemctl status ssh
3. 清理残留
移除无用包:
sudo apt autoremove && sudo apt autoclean
---
常见问题
1. 中途断网怎么办?
恢复网络后继续:
sudo apt update && sudo apt full-upgrade
2. 依赖冲突咋办?
试试修复:
sudo apt install -f
3. 系统启动不了?
用 Live CD 检查日志,修复或恢复备份。
---
结语
升级完成
回复
举报
返回列表
发布新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
精品软件
Copyright © 2001-2026
52线报网
版权所有
All Rights Reserved.
|
网站地图
闽ICP备19006036号-4
关灯
在本版发帖
扫一扫添加微信客服
返回顶部
快速回复
返回顶部
返回列表