设置默认的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