7,984
社区成员
发帖
与我相关
我的任务
分享作者:漂移菌 日期:2026-7-21
aidlux执行 sudo apt upgrade 时失败,模拟升级提示存在未满足的依赖:
kmod : Depends: libkmod2 (= 29-1ubuntu1) but 29-1ubuntu1.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install'
同时系统有 267 个软件包等待升级,但 kmod 与 libkmod2 版本不一致导致整个升级链断裂。
libkmod2 已升级到 29-1ubuntu1.1,但 kmod 仍停留在 29-1ubuntu1。kmod 的新版本 29-1ubuntu1.1 包含 /etc/modprobe.d/blacklist.conf,但该文件已被第三方包 mod-blacklist 1.0-r0(OpenEmbedded 构建)占用。apt --fix-broken install 在覆盖配置文件时触发 dpkg 冲突,导致 kmod 无法完成升级,并阻塞了依赖它的 bluez、gnome-bluetooth、indicator-bluetooth 等包。sudo apt update
输出显示 267 个软件包可升级。
sudo cp /etc/modprobe.d/blacklist.conf /etc/modprobe.d/blacklist.conf.bak.$(date +%Y%m%d)
先下载对应版本:
sudo apt-get download kmod=29-1ubuntu1.1
由于 mod-blacklist 占用了同名文件,使用 dpkg --force-overwrite 让新版 kmod 覆盖:
sudo dpkg -i --force-overwrite kmod_29-1ubuntu1.1_arm64.deb
此时会提示 libkmod2 尚未配置完成,属于正常中间状态。
为避免 dpkg 在配置文件冲突时卡住,使用非交互模式并保留旧配置:
sudo DEBIAN_FRONTEND=noninteractive apt --fix-broken install -y \
-o Dpkg::Options::="--force-confold"
该命令成功配置了 kmod、bluez、gnome-bluetooth、indicator-bluetooth。
sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y \
-o Dpkg::Options::="--force-confold"
升级过程顺利,所有可升级包均已安装。
sudo apt autoremove -y
sudo dpkg --audit
# 无输出,表示没有破损包
sudo apt --simulate upgrade
# 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded
仍有 libglapi-mesa 被保留(kept back),原因是 /etc/apt/preferences.d/osfix015_block_reinstall.pref 中对若干 Mesa/X11 相关包做了 -1 优先级固定,这是厂商(Aidlux)自定义镜像的预期行为,不影响日常使用,无需强行升级。
第二部分,就是为了能够更好的提供中文交互的功能,测试大语言模型的中文交互能力,实际上是自己懒得翻译了,哈哈
sudo apt install -y language-pack-zh-hans language-pack-zh-hans-base \
fonts-noto-cjk ibus-libpinyin
实际环境中这些包已预装,命令确保它们处于最新状态。
sudo update-locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh
验证 /etc/default/locale:
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh
注销并重新登录后,系统界面将显示为简体中文。
im-config -n ibus
gsettings set org.gnome.desktop.input-sources sources \
"[('xkb', 'us'), ('ibus', 'libpinyin')]"
gsettings set org.gnome.system.locale region 'zh_CN.UTF-8'
按 Super + Space(或点击顶部面板输入法图标)即可在英文与中文拼音输入法之间切换。
libglapi-mesa 被保留是厂商固定策略导致,不要强行使用 dpkg --force 或删除 pinning 文件,否则可能破坏图形/显示驱动。dpkg 配置文件冲突,可优先使用 DEBIAN_FRONTEND=noninteractive + --force-confold 方式处理。