WSL systemctl报错System has not been booted with systemd as init system (PID 1). Can't operate.

时间:2022-03-30 阅读:279 评论:0 作者:hkear


System has not been booted with systemd as init system (PID 1). Can't operate.

ubuntu:

apt install python2 -y
 
sudo mv /usr/bin/systemctl /usr/bin/systemctl.old
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py >temp
sudo mv temp /usr/bin/systemctl
sudo chmod +x /usr/bin/systemctl

centos:

yum -y install python2
 
mv /usr/bin/systemctl /usr/bin/systemctl.old
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py >temp
 mv temp /usr/bin/systemctl
 chmod +x /usr/bin/systemctl


本文链接: https://dkicloud.com/?id=26 转载请注明出处!