Linux Mint ToGo 系统在一段时间使用之后, 有很大的概率会在启动时自动显示 GRUB2 的菜单, 解决办法如下:
编辑 30_os-prober 文件, 在 Terminal 执行以下指令:
1
sudo xed /etc/grub.d/30_os-prober
找到以下三行代码(ctrl + f,搜索 10, ), 并注释掉
1 2 3
#if [ "\${timeout}" = 0 ]; then # set timeout=10 #fi
修改完毕, 保存、退出。
更新启动配置文件
1
sudo update-grub
执行过程如下所示:
1 2 3 4 5 6 7 8 9 10 11 12 13
$ sudo update-grub Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/50_linuxmint.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-6.17.0-20-generic Found initrd image: /boot/initrd.img-6.17.0-20-generic Found linux image: /boot/vmlinuz-6.14.0-37-generic Found initrd image: /boot/initrd.img-6.14.0-37-generic 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
设置默认的 Python
Linux Mint 自带有 python 3, 可以将其设置为默认的 Python 解释器, 步骤如下:
# Remove the GPG keyring file associated with the old repository sudorm /etc/apt/keyrings/nodesource.gpg # Remove the old repository's list file sudorm /etc/apt/sources.list.d/nodesource.list
初始化安装仓库
1 2 3 4 5 6 7 8 9 10 11 12
# Define the desired Node.js major version NODE_MAJOR=22 # Update local package index sudo apt-get update # Install necessary packages for downloading and verifying new repository information sudo apt-get install -y ca-certificates curl gnupg # Create a directory for the new repository's keyring, if it doesn't exist sudomkdir -p /etc/apt/keyrings # Download the new repository's GPG key and save it in the keyring directory curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg # Add the new repository's source list with its GPG key for package verification echo"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | sudotee /etc/apt/sources.list.d/nodesource.list
安装 Node.js
1 2 3 4
# Update local package index to recognize the new repository sudo apt-get update # Install Node.js from the new repository sudo apt-get install -y nodejs
配置 npm 使用国内镜像
1
npm config set registry https://registry.npmmirror.com