Я пытаюсь настроить статический IP для моей Linux Ubuntu 18.04. Я нашел несколько рекомендаций по созданию файла 01-netcfg.yaml в / etc / netplan /. Я написал там:
network:
version: 2
renderer: networkd
ethernets:
wifi0:
addresses: [192.168.1.2/24]
gateway4: 192.168.1.255
nameservers:
addresses: [8.8.4.4, 8.8.8.8]
Вот что я получил после sudo netplan apply
:
System has not been booted with systemd as init system (PID 1). Can't operate.
Traceback (most recent call last):
File "/usr/sbin/netplan", line 23, in <module> netplan.main()
File "/usr/share/netplan/netplan/cli/core.py", line 50, in main self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command self.func()
File "/usr/share/netplan/netplan/cli/commands/apply.py", line 43, in run self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command self.func()
File "/usr/share/netplan/netplan/cli/commands/apply.py", line 75, in command_apply
utils.systemctl_networkd('stop', sync=sync, extra_services=['netplan-wpa@*.service']) \
File "/usr/share/netplan/netplan/cli/utils.py", line 82, in systemctl_networkd
subprocess.check_call(command)
File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['systemctl', 'stop', '--no-block', 'systemd-networkd.service', 'netplan-wpa@*.service']' returned non-zero exit status 1.
Вот что у меня после ip a
(пытается настроить wifi0):
1: lo: <LOOPBACK,UP> mtu 1500 group default qlen 1
link/loopback 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope global dynamic
valid_lft forever preferred_lft forever
inet6 ::1/128 scope global dynamic
valid_lft forever preferred_lft forever
12: wifi0: <BROADCAST,MULTICAST,UP> mtu 1500 group default qlen 1
link/ieee802.11 68:a3:c4:92:1a:a5
inet 192.168.1.2/24 brd 192.168.1.255 scope global dynamic
valid_lft 86213sec preferred_lft 86213sec
inet6 fe80::4c78:b522:564f:ff24/64 scope global dynamic
valid_lft forever preferred_lft forever
Я не могу интерпретировать эту ошибку PID 1. Спасибо за помощь!