RokcyLinux 10 安装

wsl --import RockyLinux-10 ./RockyLinux-10 F:\Downloads\Rocky-10-WSL-Base.latest.x86_64.wsl --version 2

软件包配置

chsrc 安装

curl https://chsrc.run/posix | sudo bash

chsrc set rocky

epel 配置

dnf install epel-release -y

sed -e 's!^metalink=!#metalink=!g' \
    -e 's!^#baseurl=!baseurl=!g' \
    -e 's!https\?://download\.fedoraproject\.org/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' \
    -e 's!https\?://download\.example/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' \
    -i /etc/yum.repos.d/epel{,-testing}.repo
    
    
dnf update

oh my zsh 环境配置

# 安装依赖
dnf install git zsh -y


# 安装 oh my zsh
git clone https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
cd ohmyzsh/tools
REMOTE=https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git sh install.sh

git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"

powerlevel10k/powerlevel10k

vim .zshrc

plugins=(
        git
        zsh-autosuggestions
        extract
        z
        zsh-syntax-highlighting
)

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

source .zshrc

创建用户

useradd -m -s /bin/zsh spike

cp -r .oh-my-zsh /home/spike
cp .zshrc /home/spike
cp .p10k.zsh /home/spike

sudo chown -R spike:spike /home/spike/.oh-my-zsh/
sudo chown -R spike:spike /home/spike/.zshrc
sudo chown -R spike:spike /home/spike/.p10k.zsh

vim /etc/wsl.conf

[user]
default=usernname

Linuxbrew

dnf group install 'Development Tools'
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_INSTALL_FROM_API=1
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"

git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install

echo >> /home/spike/.zshrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/spike/.zshrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

echo '# Set non-default Git remotes for Homebrew/brew and Homebrew/homebrew-core.' >> /home/spike/.zshrc
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"' >> /home/spike/.zshrc
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"' >> /home/spike/.zshrc
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"

安装 nvim

brew install nvim

sudo ln -s /home/linuxbrew/.linuxbrew/bin/nvim /usr/bin/vim

安装 yazi

brew install yazi ffmpeg sevenzip jq poppler fd ripgrep fzf zoxide resvg imagemagick

function y() {
	local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
	yazi "$@" --cwd-file="$tmp"
	IFS= read -r -d '' cwd < "$tmp"
	[ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
	rm -f -- "$tmp"
}

安装 x-cmd

eval "$(curl https://get.x-cmd.com)"

安装 miniconda

# 下载脚本
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py313_25.9.1-1-Linux-x86_64.sh

sh Miniconda3-py313_25.9.1-1-Linux-x86_64.sh

eval "$(/home/spike/miniconda3/bin/conda shell.YOUR_SHELL_NAME hook)"

conda init