wsl-fedora-get-start
1. 安装 WSL Fedora
Fedora 可以官方途径安装。
sh
wsl --install FedoraLinux-42
wsl --set-default FedoraLinux-422. 换源
sh
sudo cp -a /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.backup
sudo cp -a /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates.repo.backup
sudo sed -i "s/#baseurl/baseurl/g" /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo
sudo sed -i "s/metalink/#metalink/g" /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo
sudo sed -i "s@http://download.example/pub/fedora/linux@https://mirrors.huaweicloud.com/fedora@g" /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo
dnf makecache -y
sudo dnf update -y3. 基础软件
sh
sudo dnf install vim nano git wget curl zip unzip tar -y网络
sh
sudo dnf install net-tools iputils -y进程
sh
sudo dnf install htop -y4. wsl.conf
sh
echo "[interop]
appendWindowsPath = false" | sudo tee /etc/wsl.conf重启 WSL
5. zsh
6. cpp 环境
6.1. 软件
sh
sudo dnf install gcc gcc-c++ cmake gdb -y6.2. clangd
sh
unzip clangd-linux-16.0.2.zip -d ~
rm clangd-linux-16.0.2.zip
sudo ln -s ~/clangd_16.0.2/bin/clangd /usr/local/bin/clangd6.3. clang-format
sh
echo "---
BasedOnStyle: Google
Language: Cpp
IndentWidth: 4
TabWidth: 4
---" > ~/.clang-format7. python 环境
sh
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda3.sh
bash miniconda3.sh -b -u -p ~/miniconda3
rm miniconda3.sh
~/miniconda3/bin/conda init zsh8. Node 环境
sh
sudo dnf install nodejs -y
sudo npm install --global yarn