# 配置 sudo 免密

sudo visudo

在最后加上一行(记得修改用户名为你的用户),然后保存。

<你的用户名> ALL=(ALL) NOPASSWD: ALL

# 换源、更新

略。

# 安装基础软件

sudo apt install -y \
    curl \
    git \
    zsh

# 安装 docker

curl https://get.docker.com/ | sudo bash

为 docker 加入阿里源:

sudo wget -o /etc/docker/daemon.json https://blog.lyh543.cn/mirrors/docker.json
sudo systemctl enable docker.service
sudo systemctl start docker.service

配置 docker 不需要 sudo:

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker   # log in to docker group
docker ps       # 验证更改成功

# 安装 oh-my-zsh、powerlevel10k 和 zsh-autosuggestions

安装 oh-my-zsh、powerlevel10k 和 zsh-autosuggestions:

sudo apt install -y curl git zsh unzip
# install oh-my-zsh
sh -c "$(curl -fsSL https://proxy.vvvv.ee/https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install powerlevel10k
git clone --depth=1 https://proxy.vvvv.ee/https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# install zsh-autosuggestions
git clone --depth=1 https://proxy.vvvv.ee/https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

安装 Meslo 系字体:

curl -L https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip -o ~/Meslo.zip
unzip -j ~/Meslo.zip *.ttf -d ~/.local/share/fonts
rm ~/Meslo.zip
fc-cache -fv
fc-list |  grep 'Meslo'
# 记得修改 VS Code 等 IDE 的字体为 MesloLGM Nerd Font (或 MesloLGM Nerd Font Mono,可以自行对比一下效果)

顺便也安利一下微软家的 Cascadia Code (opens new window),其中的 Cascadia Code NF 也带了 Nerd Font。如果需要可以自行下载。

修改 ~/.zshrc 中的 ZSH_THEME 为 powerlevel10k/powerlevel10k,并添加插件:

# ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"

plugins=(
    # other plugins...
    zsh-autosuggestions
)

然后重新进入 zsh,应该就能进入 powerlevel10k 的配置界面。也可以输入 p10k configure 手动进入配置界面。

picture 1

如果 MesloLGM 字体安装好了并配置为了终端的字体,在 p10k 配置过程中是能看到锁而不是乱码的。如果没有看到锁的标志,请检查终端字体。

# 安装 Linuxbrew

/bin/zsh -c "$(curl -fsSL https://brew-cn.mintimate.cn/install)"

然后更新环境变量:

export HOMEBREW_NO_AUTO_UPDATE=1

安装常用软件

brew install btop micro neofetch

# 安装 nodejs 运行环境

brew install nvm

nvm i --lts
nvm use --lts

corepack enable

# 安装 claude code

pnpm i -g @anthropic-ai/claude-code@latest

# 安装 cc switch tui

# https://ccswitch.io/en/tutorials/cc-switch-cli-headless-guide
curl -fsSL https://github.com/SaladDay/cc-switch-cli/releases/latest/download/install.sh | bash