如何从 23.04 控制台启动网络?

如何从 23.04 控制台启动网络?

我通过 do-release-upgrade 将 22.10 升级到 23.04。升级安装新文件并进行配置后,系统重新启动,但将用户转储到恢复菜单中。进入 shell 后,网络无法正常工作。文件系统都已安装并正常工作,包括 zfs 驱动器。

但是...启动时始终无法进入图形界面。要解决这个问题,让网络正常工作会很有用。

为了让网络正常运行,以下是我尝试过的方法......

% ping ubuntu.com
ping: ubuntu.com: Temporary failure in name resolution
% ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 3138  bytes 223244 (223.2 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 3138  bytes 223244 (223.2 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
% cat /etc/netplan/01-network-manager-all.yaml

以下是 /etc/netplan/01-network-manager-all.yaml 中的内容

% cat /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    eth0:
      dhcp4: true
      match:
        macaddress: 48:9e:bd:0e:ec:fa
      optional: true
      set-name: eth0
  wifis:
    wlp0s20f3:
      access-points:
        "It Hertz when IP":
          password: '@*S obvious as the light of d9y'
      dhcp4: true
      addresses:
        - 192.168.1.68/24
      routes: 
        - to: default
          via: 192.168.1.255
      match:
        macaddress: 8c:55:4a:9b:ae:2e
      optional: true

然后我尝试启动 netplan:

% netplan apply
Failed to connect system bus: Connection refused
Falling back to a hard restart of systemd-networkd.service
%

然后我尝试了 ifconfig:

% ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 20866  bytes 1485964 (1.4 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 20866  bytes 1485964 (1.4 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

因此,我尝试启动 eth0 和 wifi:

% ifconfig eth0 up
% ifconfig wlp0s20f3 up
% ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    ether 48:9e:bd:0e:ec:fa  txqueuelen 1000  (Ethernet)
    RX packets 2017  bytes 224878 (224.8 KB)
    RX errors 0  dropped 4  overruns 0  frame 0
    TX packets 14  bytes 1116 (1.1 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 20866  bytes 1485964 (1.4 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 20866  bytes 1485964 (1.4 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp0s20f3: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    ether 8c:55:4a:9b:ae:2e  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
% ping ubuntu.com
ping: ubuntu.com: Temporary failure in name resolution
% service NetworkManager start
Job for NetworkManager.service failed because the control process exited with error code.
See "systemctl status NetworkManager.service" and "journalctl -xeu NetworkManager.service" for details
% systemctl status NetworkManager.service
○ NetworkManager.service - Network Manager
 Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
 Active: inactive (dead) (Result: exit-code) since Tue 2023-05-02 13:24:05 PDT; 3min 10s ago
   Docs: man:NetworkManager(8)
Process: 39088 ExecStart=/usr/sbin/NetworkManager --no-daemon (code=exited, status=1/FAILURE)
Main PID: 39088 (code=exited, status=1/FAILURE)
    CPU: 19ms

May 02 13:24:05 Kel-Omen systemd[1]: NetworkManager.service: Scheduled restart job, restart counter is at 63.
May 02 13:24:05 Kel-Omen systemd[1]: Stopped NetworkManager.service - Network Manager.
May 02 13:24:05 Kel-Omen systemd[1]: Dependency failed for NetworkManager.service - Network Manager.
May 02 13:24:05 Kel-Omen systemd[1]: NetworkManager.service: Job NetworkManager.service/start failed with result 'dependency'.
% journalctl -xeu NetworkManager.service
May 02 13:24:05 Kel-Omen systemd[1]: Starting NetworkManager.service - Network Manager...
 Subject: A start job for unit NetworkManager.service has begun execution
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 A start job for unit NetworkManager.service has begun execution.

 The job identifier is 112974.
May 02 13:24:05 Kel-Omen NetworkManager[39088]: <info>  [1683059045.5841] NetworkManager (version 1.42.4) is starting... (after a restart, boot:389cae8a-8790-453c-a973-f4f8c13c9c4f)
May 02 13:24:05 Kel-Omen NetworkManager[39088]: <info>  [1683059045.5842] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity-ubuntu.conf, no-mac-addr-change.conf) (run: 10-globally-managed-devices.conf) (etc: default-wifi-powersave-on.conf)
May 02 13:24:05 Kel-Omen NetworkManager[39088]: <error> [1683059045.5855] bus-manager: cannot connect to D-Bus: Error receiving data: Connection reset by peer
May 02 13:24:05 Kel-Omen NetworkManager[39088]: <info>  [1683059045.5855] exiting (error)
May 02 13:24:05 Kel-Omen systemd[1]: NetworkManager.service: Main process exited,             code=exited, status=1/FAILURE
 Subject: Unit process exited
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 An ExecStart= process belonging to unit NetworkManager.service has exited.

 The process' exit code is 'exited' and its exit status is 1.
May 02 13:24:05 Kel-Omen systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
 Subject: Unit failed
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 The unit NetworkManager.service has entered the 'failed' state with result 'exit-code'.
May 02 13:24:05 Kel-Omen systemd[1]: Failed to start NetworkManager.service - Network Manager.
 Subject: A start job for unit NetworkManager.service has failed
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 A start job for unit NetworkManager.service has finished with a failure.

 The job identifier is 112974 and the job result is failed.
May 02 13:24:05 Kel-Omen systemd[1]: NetworkManager.service: Scheduled restart job, restart counter is at 63.
 Subject: Automatic restarting of a unit has been scheduled
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 Automatic restarting of the unit NetworkManager.service has been scheduled, as the result for
 the configured Restart= setting for the unit.
May 02 13:24:05 Kel-Omen systemd[1]: Stopped NetworkManager.service - Network Manager.
 Subject: A stop job for unit NetworkManager.service has finished
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 A stop job for unit NetworkManager.service has finished.

 The job identifier is 113304 and the job result is done.
May 02 13:24:05 Kel-Omen systemd[1]: Dependency failed for NetworkManager.service - Network Manager.
 Subject: A start job for unit NetworkManager.service has failed
 Defined-By: systemd
 Support: http://www.ubuntu.com/support

 A start job for unit NetworkManager.service has finished with a failure.

 The job identifier is 113304 and the job result is dependency.
May 02 13:24:05 Kel-Omen systemd[1]: NetworkManager.service: Job NetworkManager.service/start failed with result 'dependency'.

相关内容