包含关键字 linux 的文章

前两天突然出现的。

xfox@ThinkPadE14Gen3:~$ sudo apt upgrade
[sudo] xfox 的密码:正在读取软件包列表... 完成正在分析软件包的依赖关系树... 完成正在读取状态信息... 完成                 
正在计算更新... 完成升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。有 4 个软件包没有被完全安装或卸载。解压缩后会消耗 0 B 的额外空间。您希望继续执行吗? [Y/n] y
正在设置 linux-headers-6.1.0-10-amd64 (6.1.37-1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-10-amd64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j12 KERNELRELEASE=6.1.0-10-amd64 -C /lib/modules/6.1.0-10-amd64/build M=/var/lib/dkms/ntfs3/v27_20210901.lore/build...
Error!  Build of ntfs3.ko failed for: 6.1.0-10-amd64 (x86_64)
Make sure the name of the generated module is correct and at the root of the
build directory, or consult make.log in the build directory
/var/lib/dkms/ntfs3/v27_20210901.lore/build for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.1.0-10-amd64 failed!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-6.1.0-10-amd64.postinst line 11.
dpkg: 处理软件包 linux-headers-6.1.0-10-amd64 (--configure)时出错: 已安装 linux-headers-6.1.0-10-amd64 软件包 post-installation 脚本 子进程返回错误状态 1
dpkg: 依赖关系问题使得 linux-headers-amd64 的配置工作不能继续: linux-headers-amd64 依赖于 linux-headers-6.1.0-10-amd64 (= 6.1.37-1);然而:  软件包 linux-headers-6.1.0-10-amd64 尚未配置。
dpkg: 处理软件包 linux-headers-amd64 (--configure)时出错: 依赖关系问题 - 仍未被配置正在设置 linux-image-6.1.0-10-amd64 (6.1.37-1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-10-amd64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j12 KERNELRELEASE=6.1.0-10-amd64 -C /lib/modules/6.1.0-10-amd64/build M=/var/lib/dkms/ntfs3/v27_20210901.lore/build...
Error!  Build of ntfs3.ko failed for: 6.1.0-10-amd64 (x86_64)
Make sure the name of the generated module is correct and at the root of the
build directory, or consult make.log in the build directory
/var/lib/dkms/ntfs3/v27_20210901.lore/build for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.1.0-10-amd64 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: 处理软件包 linux-image-6.1.0-10-amd64 (--configure)时出错: 已安装 linux-image-6.1.0-10-amd64 软件包 post-installation 脚本 子进程返回错误状态 1
dpkg: 依赖关系问题使得 linux-image-amd64 的配置工作不能继续: linux-image-amd64 依赖于 linux-image-6.1.0-10-amd64 (= 6.1.37-1);然而:  软件包 linux-image-6.1.0-10-amd64 尚未配置。
dpkg: 处理软件包 linux-image-amd64 (--configure)时出错: 依赖关系问题 - 仍未被配置在处理时有错误发生: linux-headers-6.1.0-10-amd64
 linux-headers-amd64
 linux-image-6.1.0-10-amd64
 linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

看了看,和ntfs3内核驱动有关,我不确定这是debian12自己引入的ntfs3还是我之前瞎折腾试图编译ntfs3引入的问题。
进入目录看了看,手动编译了一下,有不少报错,我不会C也没法修。
想了想ntfs3现在对我基本上没什么用,干脆sudo rm-rf /var/lib/dkms/ntfs3/
再次执行sudo apt upgrade
问题解决。

由于技术能力有限,迁移时处理伪静态重写规则存在偏差,未能做到平滑过渡。
故经过接近6个小时的折腾才解决问题,当前博客运行于CC机房的服务器上。
PS: 我把我的家庭服务器(J3160)顺道重装Debian12了,因为之前搞的比较乱,简单备份了下关键配置就重装了。

敬告各位博友

由于全球DNS广播存在延迟,当前部分同步速度较慢的DNS服务器对主域名xfox.fun的记录还停留在旧的中国大陆境内的IP,为了避免造成误解,原服务器站点已设置强制跳转到本页面。
SSL证书等休息够再上。

- 阅读剩余部分 -

刚才看了一眼,淘宝一个店好像下架了,京东现在有货只要80块钱比我买的100多便宜了不少,不知道产品质量有无下降。

这东西我的使用体验还是不错的,不过美中不足的就是侧键的编程功能不能在无线模式下使用,必须插线,并且商家提供的控制软件只有Windows版本。

Wireshark抓包查看USB设备通讯

参考文章:Wireshark 用于USB抓包

过滤方:
usb.src == "host" and usb.dst=="1.2.0"
未完待续

本来打算玩会儿DayZ就把Windows10启动了。打开Edge发现左上角有郑州天气变化就去看了一眼(此时浏览器有新标签页和必应天气两个页面),这一看直接给我送走。
浏览器窗口疯狂频闪,最近我好像已经碰见两次浏览器频闪问题了。正写着这段文字,开了新标签页又出问题了。感觉和浏览器渲染有关,
版本如下:
Microsoft Edge 113.0.1774.50 (正式版本) (64 位)
修订 8c198093cedae51263c20d5d679dc091c24bbf87
Chromium 版本 113.0.5672.127
操作系统 Windows 10 Version 22H2 (Build 19045.2965)
JavaScript V8 11.3.10.10
用户代理 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.50
命令行 "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --profile-directory="Profile 2" --flag-switches-begin --enable-features=ParallelDownloading,Vulkan --flag-switches-end --shell-shortcut-launch-source=taskbar

想了想,我最近好像是有启用实验性功能,查看Flangs页面看到Vulkan和多线程下载启用了,关掉Vulkan,问题解决。
Vulkan
Use vulkan as the graphics backend. – Windows, Linux, Android

enable-vulkan

为什么要这么做?

你可能会像我一样遇到这样的问题:有一台你无法控制的路由器使用相同的SSID同时发射2.4Ghz和5Ghz频率的WIFI信号,而你的操作系统默认优先使用信号强度更差的5Ghz,或更糟糕的时候在两个频率上来回跳跃;无论是哪种情况这都将导致你的互联网连接处于不稳定状态,如果你在玩网络延迟需求较高的网络游戏,这将会是一个噩梦。

不是KDE用户?

别担心,其他Linux桌面环境常见的网络管理器诸如nm-connection-editor(NetworkManager)已经直接提供了简单明了的两个或三个频率的选项,你可以比KDE用户很容易的找到并调整他们。

KDE下操作指南

在KDE系统设置中找到“连接”,选中你要调整的WIFI名称,注意控制面板右侧的BSSID选项,通常情况下我建议选择信号强度更好的那个。

新硬盘和硬盘盒

如题,花了409购买了一块致态m.2 NVME. ITGZ硬盘盒花了69.

设备状态描述:

我的ThinkpadE14Gen3上有两个槽位,2230插着SN530 256G, 2280插着CUSO 250G
其中Windows10和Debian 的EFI文件都在SN530上,迁移时由于我的疏忽导致Debian的EFI文件丢失。

最终迁移过程

冗长的多次试错过程不再提及,只记录有参考价值的有效操作。
  1. 借助硬盘盒全盘克隆CUSO250G到TP5000并拆机替换
  2. 开机启动进入Grub2 command界面
  3. 使用ls命令查清Linux根分区所在硬件代号: (hd1,gpt2),注意善用TAB自动补全
    执行 set root=(hd1,gpt2)
  4. 使用cat命令查看/etc/fstab内容,得到根分区挂载路径:/dev/nvme1n1p2
  5. 查清boot分区内的待启动的vmlinuz文件路径,由于我的整个发行版都处于同一分区,故路径为/boot/vmlinuz-5.18.xxxx
    执行

    linux /boot/vmlinuz-5.18.xxxx root=/dev/nvme1n1p2

务必给内核启动参数写明root路径,否则只能进入busybox

  1. 查清待启动的initrd img路径(同在boot分区内)
    执行 initrd /boot/initrd.img-5.18.xxxx
  2. 通过grub启动,执行boot启动我的克隆来的Debian
  3. 重装grub引导
    sudo grub-install /dev/nvme1n1 #注意,此处为我的新硬盘设备顺序代号,不要填写具体的分区代号
    如果提示/usr/xxxx缺少相关文件,执行 apt reinstall grub2
    由于过去我使用SN530里的EFI分区,更换引导分区到新硬盘后应修改/etc/fstab里的/boot/efi分区对应UUID
    9.生成新的grub.cfg
    grub-mkconfig -o /boot/grub/grub.cfg
    最后sudo update-grub更新grub配置。

    双系统用户注意,如果输出内容没有看到你的WIndows引导,请自查是否启用os-prober.
    参见:从Debian11 bullseye切换到Debian12 bookworm
  4. sudo reboot 查看grub2引导界面各项目是否正常可用。

尾声

cnblog有文章提到refind引导程序的使用,如有兴趣请自行查看。
一次修复linux的efi引导的集中方法总结记录

包括之前的2.1.1~,均无法在Debian12 KDE上运行,扫码后无反应,无法正常登录。
顺带一提,微信仍然会向/etc拉屎,特别明显的就是会修改:/etc/lsb-release为以下内容:
DISTRIB_ID=Kylin
DISTRIB_RELEASE=V10
DISTRIB_CODENAME=kylin
DISTRIB_DESCRIPTION="Kylin V10 SP1"
DISTRIB_KYLIN_RELEASE=V10
DISTRIB_VERSION_TYPE=enterprise
DISTRIB_VERSION_MODE=normal
看上去是银河麒麟的标识。
很无语,国内专有软件一般不会尊重用户。国外的也半斤八两,不过没国内这么嚣张罢了。

顺带一提,卸载的时候会出现缺少文件的错误,重装再卸载也不能解决问题。
sudo rm -rf /var/lib/dpkg/info/weixin
sudo rm -rf /usr/bin/weixin
sudo apt autoremove
即可.

没事别下载国产垃圾专有软件,省得给自己找事干。

实际上Debian12尚未正式发布,但是似乎已经可用了。

升级步骤

参考文章:How to Upgrade from Debian 11 Bullseye to Debian 12 Bookworm

替换软件源

在此之前,你最好确保自己的其他软件处于bullseye的最新版本且工作正常。

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

更新并升级所有软件包

sudo apt update && sudo apt full-upgrade

重启

sudo reboot
升级完成后重启你的PC

升级后出现的问题

GRUB里Windows10启动项没了,但是这不算太严重的问题,因为我确实打算全面切换到Linux,尤其是唯一困扰已久的休眠问题已久解决的情况下,FUCK YOU Microsoft!

不过,由于我的硬盘空间不足,我还是不得不至少在笔记本上启动一次Windows以便把必必需的数据无损迁移到Ext4分区。这还需要我去买一块硬盘;)大概得等到下个月发工资的时候了。

恢复grub里的windows10启动项

xfox@ThinkPadE14Gen3:~$ sudo update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-5.18.0-0.deb11.4-amd64
Found initrd image: /boot/initrd.img-5.18.0-0.deb11.4-amd64
Found linux image: /boot/vmlinuz-5.10.0-20-amd64
Found initrd image: /boot/initrd.img-5.10.0-20-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

注意第八行提示,由于更新后的Grub软件包默认禁用os-prober,我们得手动编辑grub配置文件启用os-prober帮助grub扫描添加Windows启动项。
sudo nano /etc/default/grub
取消对GRUB_DISABLE_OS_PROBER=false的注释并保存

xfox@ThinkPadE14Gen3:~$ sudo update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-5.18.0-0.deb11.4-amd64
Found initrd image: /boot/initrd.img-5.18.0-0.deb11.4-amd64
Found linux image: /boot/vmlinuz-5.10.0-20-amd64
Found initrd image: /boot/initrd.img-5.10.0-20-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done

问题解决

我的升级获益

  1. 困扰我已久的系统休眠可以正常工作了(我一直有预感debian12会解决这个问题,很高兴我的预感的确很准确。)
  2. 笔记本低负载下(比如现在我在写博客)发热明显降低,续航似乎也比Debian11有所增强。
  3. 更漂亮的GRUB启动图片

看来一些人喜欢arch linux的滚动更新也并非没有道理,许多linux发行版的稳定版特别是LTS对新的桌面PC的支持都并不友好,但是这些新设备的支持往往已久被加入更新的软件版本了,对于因此对于自己手头常用的新PC产品并不应该过于执着稳定版,尚未发布的版本往往对新设备用户准备了惊喜/吓。
尽管休眠已经可用,我发现睡眠似乎还是出现睡眠后无法登录的问题,只能强制关机。
但是cat /sys/power/state发现返回值变成了freeze mem disk (在debian11的时候仅仅支持freeze和mem)
参见查看当前内核支持的休眠模式
经手动测试,freeze,mem,模式是正常可用的。
disk模式在测试时被发现电源指示灯闪烁后屏幕恢复休眠瞬间的界面并卡死。(但是我点击KDE休眠选项真的可以正常休眠和唤醒)

未完待续