隐私设置

  1. 禁用最近文档, 在菜单中选择: System Settings -> Privacy, 在打开的 Privacy 窗口中, 将 Remember recently accessed files 关闭即可。
  1. 清除 Terminal 中的所有历史记录
1
echo > ~/.bash_history 
  1. 清除当前 Terminal 窗口中的历史记录
1
history -c

跳过 GRUB2 的引导菜单

Linux Mint ToGo 系统在一段时间使用之后, 有很大的概率会在启动时自动显示 GRUB2 的菜单, 解决办法如下:

  1. 编辑 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. 更新启动配置文件
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 解释器, 步骤如下:

  1. 使用 whereis 命令查看 Python 安装的位置
1
whereis python3

命令执行结果如下:

1
2
laohoo@laohoo-Inspiron-7559:~$ whereis python3
python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /usr/share/man/man1/python3.1.gz
  1. 使用 update-alternatives 设置默认 Python 版本
1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1

安装 Visual Studio Code

apt 存储库要手动安装

  1. 运行以下脚本来安装签名密钥:
1
2
3
4
sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -D -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/microsoft.gpg
rm -f microsoft.gpg
  1. 创建一个 /etc/apt/sources.list.d/vscode.sources 文件
1
sudo xed /etc/apt/sources.list.d/vscode.sources

并添加以下内容, 以添加对上游包存储库的引用:

1
2
3
4
5
6
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: amd64,arm64,armhf
Signed-By: /usr/share/keyrings/microsoft.gpg
  1. 最后, 更新软件包缓存并安装软件包:
1
2
3
sudo apt install apt-transport-https
sudo apt update
sudo apt install code # or code-insiders

安装 node.js

  1. 删除旧版仓库配置信息
1
2
3
4
# Remove the GPG keyring file associated with the old repository
sudo rm /etc/apt/keyrings/nodesource.gpg
# Remove the old repository's list file
sudo rm /etc/apt/sources.list.d/nodesource.list
  1. 初始化安装仓库
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
sudo mkdir -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" | sudo tee /etc/apt/sources.list.d/nodesource.list
  1. 安装 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
  1. 配置 npm 使用国内镜像
1
npm config set registry https://registry.npmmirror.com