今天在wsl執(zhí)行systemctl報以下錯,
systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
Failed to reload daemon: Interactive authentication required.
Failed to reload daemon: Interactive authentication required.
Failed to enable unit: Interactive authentication required.
?百度找了下解決辦法,親測可行。
1、在命令窗口執(zhí)行wsl -l -v查看wsl的版本,如果不是2需要先更新wsl --update
?2、在wls窗口 /etc下新建wsl.conf,內(nèi)容:
[boot]
systemd=true
?3、關(guān)閉wsl窗口,在命令窗口執(zhí)行wsl --shutdown將wsl關(guān)閉文章來源:http://www.zghlxwxcb.cn/news/detail-517836.html
4、重新打開wsl窗口,現(xiàn)在systemctl命令就可以使用了。文章來源地址http://www.zghlxwxcb.cn/news/detail-517836.html
到了這里,關(guān)于WSL ubuntu使用systemctl命令報錯,解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!