# 换源、更新

略。

# 安装软件

# 安装基础软件

sudo apt install -y \
    curl \
    git \
    htop \
    micro \
    neofetch \
    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://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# install zsh-autosuggestions
git clone --depth=1 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,可以自行对比一下效果)

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

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

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

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

picture 1

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

# 配置

# sudo 免密

sudo visudo

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

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