Debian 12 Bookworm 尝鲜记,由于GNOME桌面环


前几天在网上看到 Debian 12 的开发代号定下来了,是 Bookworm,好奇地去清华源看了一看,结果看到了这个:

我目瞪狗呆(0-0),Debian 12 不是预计在 2023 年中期发布吗?这下镜像源都出来了!不过既然源出来了,那不就可以提前尝鲜 Debian 12 啦?我立马在我的树莓派上行动了起来~

-----------------------正文-------------------------

1. 准备

硬件要求:一台装好 Debian 或 Raspbian 的树莓派 / PC

2. 安装 Debian 12

在更新前先确定你的电脑装的是不是 Debian 11:

lsb_release -a

如果弹出的信息里有 bullseye 就说明你的电脑是 Debian 11(bullseye 是 debian 11 的开发代号),如果没有要先升级到 Debian 11 再进行下一步操作~

更新现有的软件至 Debian 11 的最新版本:

sudo apt-get update
sudo apt-get upgrade

然后把 /etc/apt/sources.list 里面的内容全部注释掉,增加以下 Debian 12 的软件源:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free

更新一下软件源:

sudo apt-get update

然后更新现有的 Debian 11 软件至 Debian 12:

sudo apt-get upgrade

期间如果不跑代码终端跳出来一些字符,Q 退出~

安装完后更新 Debian 系统内核至 Debian 12:

sudo apt-get full-upgrade

期间会好几次不跑代码终端提示,第一次 Q 退出,后面全部输入 Y 同意更改~

等到它代码跑完,输入 sudo reboot 重启~

3. 安装后问题

重启之后你可能会发现:之前的 UI 哪去了?怎么换上了一个这么丑的 LXDE 桌面环境?

这是因为 Debian 12 还不稳定,原来的 UI 与其它包发生了依赖冲突,所以这就是升级 Debian 12 的代价~

目前测试通过的 Debian 12 可用桌面环境有三个:LXDE(就是自带的那个),xfce4,GNOME。由于 GNOME 桌面环境比较好看,所以这里我们以 GNOME 为例。

输入以下命令安装 aptitude(aptitude 是一个类似 apt 的包管理器,它处理依赖关系更加智能,很多软件 apt 不能装的 aptitude 都可以装,比如 GNOME。不过安装软件尽量使用 apt-get,系统原生兼容性比较好,实在不行才用 aptitude)

sudo apt-get install aptitude

然后安装 GNOME:

aptitude install gnome

如果不想安装 GNOME 自带的一些软件可以安装 GNOME 核心版:

aptitude install gnome-core

安装完后选择 GNOME 作为默认桌面环境:

update-alternatives --config x-session-manager

当它提示类似下图的信息时,选择 gnome-session 那个:

There are 3 choices for the alternative x-session-manager (providing /usr/bin/x-session-manager).
 
  Selection    Path                    Priority   Status
------------------------------------------------------------
* 0            /usr/bin/lxde-loader     50        auto mode
  1            /usr/bin/gnome-session   50        manual mode
  2            /usr/bin/startxfce4      50        manual mode
  3            /usr/bin/xfce4-session   40        manual mode
 
Press <enter> to keep the current choice[*], or type selection number:1

完成后 sudo reboot 重启,你就会发现自动重启 GNOME 环境啦~

(另外进入 GNOME 后可能会发现下面的 Debian 版本号是 Debian 11,个人理解,这是因为 GNOME 还没做出 Debian 12 的 logo~ 如果想验证装的是不是 Debian 12,可以 lsb_release -a,如果打印的信息里有 Debian 12 的开发代号 bookworm 那就说明装的是真的 Debian 12~)

PS:由于 GNOME 桌面环境自带了很多软件,而大部分都是我们不需要的。下面分享一些卸载原生软件的方法~

卸载原生自带的游戏:

sudo apt-get purge gnome-games
sudo apt-get --purge autoremove

卸载原生自带的 LibreOffice 办公套件:

sudo apt-get purge libreoffice*
sudo apt-get --purge autoremove 

卸载其它不需要的软件:设置 -> 应用程序里卸载~

相关内容