我想在Windows 11上的Ubuntu上安装k9s。
当我试图安装它时,我会得到一个错误,即该管理单元已关闭:
➜ ~ sudo snap install k9s
error: cannot communicate with server: Post http://localhost/v2/snaps/k9s: dial unix /run/snapd.socket: connect: no such file or directory
当我启动管理单元时,我得到一个新错误:
➜ ~ systemctl start snapd.service
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
有人知道我该怎么做吗?
发布于 2022-08-22 16:06:45
这是WSL2的一个问题,您可以通过运行以下命令来修复它:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
来源:https://github.com/microsoft/WSL/issues/5126#issuecomment-653715201
https://askubuntu.com/questions/1407547
复制相似问题