WSL2 Arch Linux ,需要用到 docker 。docker 是通过 genie 实现 systemctl 功能,然后安装的(不是安装的 Windows 的 docker desktop )
拉容器在更换清华源并执行apt-get update指令后会出现如下报错
Err:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
查询 StackOverflow 以后,修改/etc/resolv.conf中nameserver 127.x.x.x的值为8.8.8.8,确实可以解决问题
问题是同时设置了 WSL2 访问 clash for Windows 来翻墙,修改了nameserver以后就失效了
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
export https_proxy="http://${hostip}:7890"
export http_proxy="http://${hostip}:7890"
如何可以解决这个问题呢,换用 docker desktop 可行吗?(主要是不想在 Windows 上下载这种东西)