C:\Users\Username\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState
C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.610.0_x64__79rhkp1fndgsc
C盘空间少可以使用本方法
以下命令均在PowerShell管理员模式下运行
wsl --shutdown
wsl -l -v
wsl --export Ubuntu-20.04 D:\utd\ubuntu.tar
wslconfig /u ubuntu-20.04
wsl --import Ubuntu-20.04 D:\ubuntu D:\utd\ubuntu.tar
wslconfig /s ubuntu-20.04
!!! 到目前为止,转移ubuntu-20.04已经完成 !!!
del /F /S /Q D:\ubuntu
ubuntu2004.exe config --default-user hi
net stop LxssManager
net start LxssManager
sudo vi /etc/profile
按一下键盘的A或者 i 后 把以下内容添加到文件中(自行更改IP)
export all_proxy="http://192.168.2.100:1080"
export http_proxy="http://192.168.2.100:1080"
export https_proxy="http://192.168.2.100:1080"
# export all_proxy="socks5://192.168.2.100:1080"
按ESC后输入 :wq 即可保存文件 然后输入
source /etc/profile
export all_proxy="http://192.168.2.100:1080"
export http_proxy="http://192.168.2.100:1080"
export https_proxy="http://192.168.2.100:1080"
# export all_proxy="socks5://192.168.2.100:1080"
参考:https://zhuanlan.zhihu.com/p/348583848
sudo lsb_release -a
sudo rm -rf /etc/apt/sources.list
sudo vi /etc/apt/sources.list
按一下键盘的 A 或者 i 后 复制以下内容到sources.list
# Ubuntu 20.04.2.0 LTS (Focal Fossa)
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# 参考
https://wiki.ubuntu.org.cn/%E6%A8%A1%E6%9D%BF:Ubuntu_source
# 其他源(替换域名即可)
https://mirrors.163.com/ubuntu/
https://mirrors.aliyun.com/ubuntu/
https://mirrors.sohu.com/ubuntu/
https://mirrors.cloud.tencent.com/ubuntu/
https://mirrors.ustc.edu.cn/ubuntu/
按ESC后输入 :wq 即可保存文件
sudo apt-get update
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync grep libc-dev perl ack bison ccache cmake cpio ecj fastjar haveged help2man intltool libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libreadline-dev lrzsz mkisofs nano ninja-build pkgconf python3-pip python3-ply python-docutils re2c scons squashfs-tools upx-ucl xxd
sudo apt update -y
sudo apt full-upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext git git-core gperf haveged \
help2man intltool lib32gcc1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev \
libmpfr-dev libncurses5-dev libncurses5-dev libreadline-dev libssl-dev libtool libz-dev lrzsz mkisofs msmtp \
nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply python-docutils \
qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto \
xxd zlib1g-dev
curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh | sudo bash
等待环境部署完成
git clone -b master --single-branch https://github.com/coolsnowwolf/lede
贴几个地址openwrt(排名不分先后)
git clone -b openwrt-18.06 --single-branch https://github.com/immortalwrt/immortalwrt
git clone -b master --single-branch https://github.com/x-wrt/x-wrt
git clone -b master --single-branch https://github.com/openwrt/openwrt
git clone -b main --single-branch https://github.com/Lienol/openwrt
git clone -b lede-17.01 --single-branch https://github.com/coolsnowwolf/openwrt
cd lede
# cd i
sed -i '$a src-git NueXini_Packages https://github.com/NueXini/NueXini_Packages.git' feeds.conf.default
sed -i 's/192.168.1.*.1/192.168.3.1/g' package/base-files/files/bin/config_generate
./scripts/feeds update -a
./scripts/feeds install -a
sed -i 's/luci-theme-bootstrap/luci-theme-argon/g' feeds/luci/collections/luci/Makefile
(version release)
sed -i 's#%D#&/NueXini#g' package/base-files/files/etc/openwrt_release
sed -i 's#ImmortalWrt#&/NueXini#g' include/version.mk
sed -i 's#_DIST),OpenWrt#&/NueXini#g' include/version.mk
make menuconfig
make -j8 download
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
如果有错误请用
make -j1 V=sc download
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make -j4
(make -j4 这里用的是4线程)
(也可以导入路径,免去路径输入的烦恼)
sudo vi /etc/profile
输入以下内容后保存
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH
编译完成后输出路径:bin/targets
cd lede
# cd openwrt
# cd immortalwrt
git pull
./scripts/feeds update -a && ./scripts/feeds install -a
# 编译有出错的请使用(清除bin和build_dir目录)
make clean
# make clean + 清除交叉编译工具
# make dirclean
# 你想回到最初状态的话
# make distclean
make defconfig
make -j8 download
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make -j4
rm -rf ./tmp && rm -rf .config
make menuconfig
make -j8 download
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make -j4