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

简介: System has not been booted with systemd as init system (PID 1). Can‘t operate.

win11 安装Ubuntu 222.04LST 启动docker报错

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

执行

# service --status-all
# 启动守护dockerd
sudo dockerd

显示

failed to start daemon: Error initializing network controller: error obtaining controller instance: unable to add return rule in DOCKER-ISOLATION-STAGE-1 chain:  (iptables failed: iptables --wait -A DOCKER-ISOLATION-STAGE-1 -j RETURN: iptables v1.8.7 (nf_tables):  RULE_APPEND failed (No such file or directory): rule in chain DOCKER-ISOLATION-STAGE-1

解决:

  1. 将iptables用iptables-legacy替换:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
  1. 开启 ipv4 的包转发功能:
sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
# 启动Docker
sudo service docker start


相关文章
|
Ubuntu 网络安全
Unit firewalld.service could not be found.
Unit firewalld.service could not be found.
768 0
|
8月前
|
开发工具
【云手机】(systemctl)解决:System has not been booted with systemd as init system (PID 1). Can't ope...
【云手机】(systemctl)解决:System has not been booted with systemd as init system (PID 1). Can't ope...
2856 0
|
8月前
|
Ubuntu Linux
Ubuntu 报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.
系统未使用 `systemd` 初始化导致错误。解决方法是通过 `apt` 安装。首先备份并更换`sources.list`,添加阿里云镜像源,然后更新源并以管理员权限运行 `apt-get install systemd -y` 和 `apt-get install systemctl -y` 安装所需组件。
3594 3
System.exit(0)和System.exit(1)区别
System.exit(0)和System.exit(1)区别
|
Linux Docker 容器
docker报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.
docker报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.
1665 0
启动报错“An operating system wasn't found”
分享一个启动报错“An operating system wasn't found”的案例
启动报错“An operating system wasn't found”
|
Linux 虚拟化
安装centos7 报错[FAILED] Failed to start Switch Root. see 'systemctl status initrd-switch-root.service' for details
安装centos7 报错[FAILED] Failed to start Switch Root. see 'systemctl status initrd-switch-root.service' for details
24697 0
|
网络安全
Linux_异常_03_Failed to restart iptables.service: Unit not found.
启动防火墙时出现: Failed to restart iptables.service: Unit not found.     解决方案: 1.https://stackoverflow.
8350 0