wsl中安装Fedora系统遇到的问题与解决 - aierlma/git_instructions GitHub Wiki

windows商店的Fedora非官方 powershell里

wsl --set-default-version 1 安装完后如果没有新建账户,首先先给root账户设置密码 Linux里

sudo passwd root 再新建账户

useradd xxx
passwd xxx

在powershell里设置新用户为默认账户 Fedora config --default-user xxx

如果提示xxx is not in the sudoers file

$ su root
$ vim /etc/sudoers

找到“root ALL=(ALL) ALL”一行,在下面插入新的一行,内容是“xxx ALL=(ALL) ALL”,然后在vim键入命令“:wq!”保存并退出

将系统从c盘迁移至d盘 首先powershell查看版本号

wsl -l 然后在d盘新建文件夹d://wsl//Fedora//

执行

wsl --export Fedora d://wsl//Fedora//Fedora.tar
wsl --unregister Fedora
wsl --import Fedora d://wsl//Fedora d://wsl//Fedora//Fedora.tar

其中Fedora是版本号

dnf换国内源(参考Fedora镜像) 原来的先备份

mv /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.backup
mv /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates.repo.backup

下载阿里自己的设置

wget -O /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo
wget -O /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo

pip换源

mkdir ~/.pip
vim ~/.pip/pip.conf

写成或改成

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com