每次重启时网络仍处于禁用状态

每次重启时网络仍处于禁用状态

我正在使用 Kubuntu 23.04。几天前我尝试升级到 23.10 版本。由于 grub-loader 位置存在问题,升级失败。无论如何。我设法将系统降级回 23.04,没有丢失任何数据。但从那天起,我一直面临网络问题。从那时起,我的网络就被禁用了。每次重启时,我都需要运行以下命令才能使其正常工作。

sudo ip link set enp0s31f6 up
sudo dhclient enp0s31f6
sudo systemctl restart smbd
sudo systemctl restart nmbd

是的,出于某种原因,我的 samba 共享也不起作用,除非我在每次重启时重新启动服务。作为临时解决方案,我可以忍受,但这太令人恼火了。我尝试了几种解决方案,但似乎都没有解决我的问题。

我尝试重新安装网络管理器,但没有成功。/etc/network/interfaces文件丢失,因此我创建并添加了以下代码。

auth enp0s31f6

auto lo enp0s31f6
iface lo inet loopback

iface enp0s31f6 inet dhcp

这也不起作用。

/etc/netplan目录只有一个文件 -01-network-manager-all.yaml并且它包含以下内容。

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

我把它改成了

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
     enp0s31f6:
        dhcp4: true

但这也不起作用。

这是命令的输出sudo systemctl status NetworkManager

● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
     Active: active (running) since Fri 2023-12-15 13:59:12 IST; 18min ago
       Docs: man:NetworkManager(8)
   Main PID: 789 (NetworkManager)
      Tasks: 4 (limit: 28624)
     Memory: 7.1M
        CPU: 81ms
     CGroup: /system.slice/NetworkManager.service
             └─789 /usr/sbin/NetworkManager --no-daemon

Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5578] ifupdown: guessed connection type (enp0s31f6) = 802-3-ethernet
Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5692] dhcp: init: Using DHCP client 'internal'
Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5694] manager: (lo): new Loopback device (/org/freedesktop/NetworkManager/Devices/1)
Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5735] manager: (enp0s31f6): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5779] failed to open /run/network/ifstate
Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5812] manager: startup complete
Dec 15 13:59:12 wfh NetworkManager[789]: <info>  [1702628952.5872] modem-manager: ModemManager available
Dec 15 13:59:26 wfh NetworkManager[789]: <info>  [1702628966.4424] agent-manager: agent[e6db1e7db18d032b,:1.46/org.kde.plasma.networkmanagement/1000]: ag>
Dec 15 14:00:19 wfh NetworkManager[789]: <info>  [1702629019.5368] device (enp0s31f6): carrier: link connected
Dec 15 14:00:20 wfh NetworkManager[789]: <info>  [1702629020.5622] failed to open /run/network/ifstate

/run/network/ifstate如您所见,文件丢失。

这是命令的状态sudo dpkg -s linux-modules-extra-$(uname -r) | grep Status

Status: install ok installed

这是命令的状态dpkg -l | grep linux

ii  binutils-x86-64-linux-gnu                     2.40-2ubuntu4                                        amd64        GNU binary utilities, for x86-64-linux-gnu target
ii  console-setup-linux                           1.217ubuntu3                                         all          Linux specific part of console-setup
ii  libselinux1:amd64                             3.4-1build4                                          amd64        SELinux runtime shared libraries
ii  libv4l-0:amd64                                1.22.1-5build1                                       amd64        Collection of video4linux support libraries
ii  libv4lconvert0:amd64                          1.22.1-5build1                                       amd64        Video4linux frame format conversion library
ii  linux-base                                    4.5ubuntu9                                           all          Linux image base package
ii  linux-firmware                                20230323.gitbcdcfbcf-0ubuntu1                        all          Firmware for Linux kernel drivers
ii  linux-generic                                 6.2.0.20.20                                          amd64        Complete Generic Linux kernel and headers
ii  linux-headers-6.2.0-20                        6.2.0-20.20                                          all          Header files related to Linux kernel version 6.2.0
ii  linux-headers-6.2.0-20-generic                6.2.0-20.20                                          amd64        Linux kernel headers for version 6.2.0 on 64 bit x86 SMP
ii  linux-headers-6.2.0-39                        6.2.0-39.40                                          all          Header files related to Linux kernel version 6.2.0
ii  linux-headers-6.2.0-39-generic                6.2.0-39.40                                          amd64        Linux kernel headers for version 6.2.0 on 64 bit x86 SMP
ii  linux-headers-generic                         6.2.0.20.20                                          amd64        Generic Linux kernel headers
ii  linux-image-6.2.0-20-generic                  6.2.0-20.20                                          amd64        Signed kernel image generic
rc  linux-image-6.2.0-26-generic                  6.2.0-26.26                                          amd64        Signed kernel image generic
rc  linux-image-6.2.0-32-generic                  6.2.0-32.32                                          amd64        Signed kernel image generic
rc  linux-image-6.2.0-33-generic                  6.2.0-33.33+1                                        amd64        Signed kernel image generic
rc  linux-image-6.2.0-34-generic                  6.2.0-34.34                                          amd64        Signed kernel image generic
rc  linux-image-6.2.0-35-generic                  6.2.0-35.35                                          amd64        Signed kernel image generic
rc  linux-image-6.2.0-36-generic                  6.2.0-36.37                                          amd64        Signed kernel image generic
ii  linux-image-6.2.0-39-generic                  6.2.0-39.40                                          amd64        Signed kernel image generic
ii  linux-image-6.5.0-14-generic                  6.5.0-14.14                                          amd64        Signed kernel image generic
ii  linux-image-generic                           6.2.0.20.20                                          amd64        Generic Linux kernel image
ii  linux-libc-dev:amd64                          6.2.0-20.20                                          amd64        Linux Kernel Headers for development
ii  linux-modules-6.2.0-20-generic                6.2.0-20.20                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-6.2.0-26-generic                6.2.0-26.26                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-6.2.0-32-generic                6.2.0-32.32                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-6.2.0-33-generic                6.2.0-33.33                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-6.2.0-34-generic                6.2.0-34.34                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-6.2.0-35-generic                6.2.0-35.35                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-6.2.0-36-generic                6.2.0-36.37                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
ii  linux-modules-6.2.0-39-generic                6.2.0-39.40                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
ii  linux-modules-6.5.0-14-generic                6.5.0-14.14                                          amd64        Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP
ii  linux-modules-extra-6.2.0-20-generic          6.2.0-20.20                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-extra-6.2.0-26-generic          6.2.0-26.26                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-extra-6.2.0-32-generic          6.2.0-32.32                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-extra-6.2.0-33-generic          6.2.0-33.33                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-extra-6.2.0-34-generic          6.2.0-34.34                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-extra-6.2.0-35-generic          6.2.0-35.35                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc  linux-modules-extra-6.2.0-36-generic          6.2.0-36.37                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
ii  linux-modules-extra-6.2.0-39-generic          6.2.0-39.40                                          amd64        Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
ii  linux-modules-extra-6.5.0-14-generic          6.5.0-14.14                                          amd64        Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP
rc  linux-modules-nvidia-470-6.2.0-20-generic     6.2.0-20.20                                          amd64        Linux kernel nvidia modules for version 6.2.0-20
rc  linux-modules-nvidia-470-6.2.0-26-generic     6.2.0-26.26+2                                        amd64        Linux kernel nvidia modules for version 6.2.0-26
rc  linux-modules-nvidia-470-6.2.0-32-generic     6.2.0-32.32                                          amd64        Linux kernel nvidia modules for version 6.2.0-32
rc  linux-modules-nvidia-470-6.2.0-33-generic     6.2.0-33.33+3                                        amd64        Linux kernel nvidia modules for version 6.2.0-33
rc  linux-modules-nvidia-470-6.2.0-34-generic     6.2.0-34.34+1                                        amd64        Linux kernel nvidia modules for version 6.2.0-34
rc  linux-modules-nvidia-470-6.2.0-35-generic     6.2.0-35.35                                          amd64        Linux kernel nvidia modules for version 6.2.0-35
rc  linux-modules-nvidia-470-6.2.0-36-generic     6.2.0-36.37+1                                        amd64        Linux kernel nvidia modules for version 6.2.0-36
rc  linux-modules-nvidia-470-6.2.0-39-generic     6.2.0-39.40                                          amd64        Linux kernel nvidia modules for version 6.2.0-39
rc  linux-modules-nvidia-470-6.5.0-14-generic     6.5.0-14.14                                          amd64        Linux kernel nvidia modules for version 6.5.0-14
rc  linux-objects-nvidia-470-6.2.0-20-generic     6.2.0-20.20                                          amd64        Linux kernel nvidia modules for version 6.2.0-20 (objects)
rc  linux-objects-nvidia-470-6.2.0-26-generic     6.2.0-26.26+2                                        amd64        Linux kernel nvidia modules for version 6.2.0-26 (objects)
rc  linux-objects-nvidia-470-6.2.0-32-generic     6.2.0-32.32                                          amd64        Linux kernel nvidia modules for version 6.2.0-32 (objects)
rc  linux-objects-nvidia-470-6.2.0-33-generic     6.2.0-33.33+3                                        amd64        Linux kernel nvidia modules for version 6.2.0-33 (objects)
rc  linux-objects-nvidia-470-6.2.0-34-generic     6.2.0-34.34+1                                        amd64        Linux kernel nvidia modules for version 6.2.0-34 (objects)
rc  linux-objects-nvidia-470-6.2.0-35-generic     6.2.0-35.35                                          amd64        Linux kernel nvidia modules for version 6.2.0-35 (objects)
rc  linux-objects-nvidia-470-6.2.0-36-generic     6.2.0-36.37+1                                        amd64        Linux kernel nvidia modules for version 6.2.0-36 (objects)
ii  linux-objects-nvidia-470-6.2.0-39-generic     6.2.0-39.40                                          amd64        Linux kernel nvidia modules for version 6.2.0-39 (objects)
ii  linux-objects-nvidia-470-6.5.0-14-generic     6.5.0-14.14                                          amd64        Linux kernel nvidia modules for version 6.5.0-14 (objects)
ii  linux-signatures-nvidia-6.2.0-39-generic      6.2.0-39.40                                          amd64        Linux kernel signatures for nvidia modules for version 6.2.0-39-generic
ii  linux-signatures-nvidia-6.5.0-14-generic      6.5.0-14.14                                          amd64        Linux kernel signatures for nvidia modules for version 6.5.0-14-generic
ii  linux-sound-base                              1.0.25+dfsg-0ubuntu7                                 all          base package for ALSA and OSS sound systems
ii  pptp-linux                                    1.10.0-1build3                                       amd64        Point-to-Point Tunneling Protocol (PPTP) Client
ii  util-linux                                    2.38.1-4ubuntu1                                      amd64        miscellaneous system utilities
ii  util-linux-extra                              2.38.1-4ubuntu1                                      amd64        interactive login tools

我不知道还能尝试什么。如果您需要更多信息,请告诉我。即使使用命令启用网络后,我的网络状态图标仍是这样的。

网络 系统托盘图标 kubuntu 23.04

我第一次看到缺少网络选项时必须手动创建它。创建它没有任何作用。

现在做什么?

网络系统设置菜单

相关内容