Debian 11 Bullseye 升级 Debian 12 Bookworm

本文将指导如何升级 Debian 11 Bullseye 到 Debian 12 Bookworm。

准备工作

除非你是物理服务器,以及没有用过奇奇怪怪定制或修改的内核的 KVM 构架的 VPS 和云主机,否则升级大版本更新内核是有一定机率导致 Grub 加载失败的,切记备份重要数据!

OpenVZ 6 和 LXC 构架的 VPS 是无法升级的,因为他们没有自己独立的内核

再强调一遍,一定要备份重要数据!

以下操作需要在 root 用户下完成,请使用 sudo -isu root 切换到 root 用户进行操作

更新系统

首先需要更新你当前的系统

apt update
apt upgrade -y
apt dist-upgrade -y
apt autoclean
apt autoremove -y

如果内核更新了,可以重启让最新的内核生效,也可以直接进行升级。

升级系统

首先更新 apt 源,替换 bullseye 为 bookworm:

sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list

对于 Debian 12 以后的版本,所有 Debian 可以分发的打包的非自由固件二进制文件(non-free),比如某些驱动,都被转移到 Debian Archive 中的一个新组件,称为非自由固件(non-free-firmware)。如果您从旧版的 Debian 升级,并且需要这些固件二进制文件,您应该更新您系统上的 /etc/apt/sources.list,以使用这个新组件(来源):

sed -i 's/non-free/non-free non-free-firmware/g' /etc/apt/sources.list

默认的系统 apt 源文件 /etc/apt/sources.list 应该是类似这样的:

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

国内服务器可以替换 deb.debian.orgsecurity.debian.orgmirrors.tuna.tsinghua.edu.cn

然后我们再次执行更新系统:

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

更新过程种会提示一些软件是否需要自动重启,选 Yes 即可,以及一些软件的配置文件是否需要更新,按照自己的情况选择即可,默认回车即视为使用旧的配置文件,一般会出现在 OpenSSH 等软件的更新上。

注意某些软件更新后可能会更新 systemd 服务配置,此时我们可以执行 systemctl daemon-reload 重新加载配置。

如果升级的时候遇到了如下错误:

Setting up dbus-daemon (1.14.6-1) ...
UUID file '/var/lib/dbus/machine-id' should contain a hex string of length 32, not length 0, with no other text
dpkg: error processing package dbus-daemon (--configure):
 installed dbus-daemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of dbus:
 dbus depends on dbus-daemon (= 1.14.6-1); however:
  Package dbus-daemon is not configured yet.

dpkg: error processing package dbus (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.36-9) ...
Errors were encountered while processing:
 dbus-daemon
 dbus
E: Sub-process /usr/bin/dpkg returned an error code (1)

删除 /var/lib/dbus/machine-id 这个空文件后重新执行命令即可,升级 dbus 时会自动生成这个文件。

rm -rf /var/lib/dbus/machine-id

更新后删除不必要的软件和依赖:

apt autoclean
apt autoremove -y

然后我们使用 reboot 命令重启系统,耐心等待后,查看最新的系统版本:

root@debian ~ # cat /etc/debian_version 
12.0

root@debian ~ # lsb_release -a
No LSB modules are available.
Distributor ID:Debian
Description:Debian GNU/Linux 12 (bookworm)
Release:12
Codename:bookworm
root@debian ~ # uname -a
Linux debian 6.1.0-9-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux

这时我们就已经更新到了最新的 Debian 12 Bookworm 和内核了。

本文来自 1

Read more

榨干 ORACLE ARM 5/ 安装 Windows

榨干 ORACLE ARM 5/ 安装 Windows

不建议,具有删号的风险、具有变砖的风险。不适合不会救砖的同学。 准备工作 登录 OCI 后台,设置一下实例【传输中加密】为【已禁用】 安装依赖 apt install curl wget -y 安装 Windows 1、DD 的方式,大概历时 15 分钟 curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh && bash reinstall.sh dd --img https://r2.hotdog.eu.org/win11-arm-with-pagefile-15g.

By YJK
自建 Docker Hub 镜像

自建 Docker Hub 镜像

使用 Nginx server { listen 443 ssl; server_name 域名; ssl_certificate 证书地址; ssl_certificate_key 密钥地址; ssl_session_timeout 24h; ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256'; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; location / { proxy_pass https://registry-1.docker.io; # Docker Hub 的官方镜像仓库 proxy_

By YJK
[AD] 闲置 VPS 挂机赚钱 | 已提现超过 100 USD

[AD] 闲置 VPS 挂机赚钱 | 已提现超过 100 USD

闲置 VPS 挂机销售流量赚钱,通过以下链接注册赠送 5USD,即只要再挂满 5USD 便可提现 10USD,可通过 USDT(TRC20) 提现至 Crypto 钱包。 * https://traffmonetizer.com/?aff=793646 根据 TM 最新的政策, 新注册账号未赠送 5 USD。 还有一个 Repocket,注册送 5U,满 20U 10USD 提现。 Repocket 更新了它的提现政策,满 10 刀即可通过 Paypal、Wise 提现。 * https://link.repocket.co/BTrB Traffmonetizer 挂机方法 1/

By YJK
快速精简 Windows 11

快速精简 Windows 11

1. 使用 tiny11builder 快速构建 Windows 11 精简系统 2. 使用 Win11Debloat 精简现有 Windows 11 操作系统 使用 tiny11builder 快速构建 Windows 11 精简系统 用户现在可以使用 tiny11builder 轻松构建一个精简版的 Windows 11 系统,优化性能同时保持核心功能,避免使用被植入病毒的第三方精简系统。本文将指导你如何使用 tiny11builder 来创建一个轻量级的 Windows 11 系统。 步骤 1: 准备工作 在开始之前,你需要确保已经满足以下条件: 1. 一台运行 Windows 10 或更高版本的计算机; 2. 准备一个 Windows 11 ISO 文件,

By YJK
Mastodon