当前位置:   article > 正文

Ubuntu 20.04.3无法获取ip不能上网,重启网络出现unit NetworkManager.service not found_ubuntu unit network-manager.service not found

ubuntu unit network-manager.service not found

环境:

Ubuntu 20.04.3-live-server

问题描述:

无法获取ip不能上网,重启网络出现unit NetworkManager.service not found

ubuntu:~$ service network restart
Failed to restart network.service: Unit network.service not found.
  • 1
  • 2

解决方案:

1.查看netplan配置文件
cat /etc/netplan/00-installer-config.yaml

#This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      dhcp4: true
  version: 2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

2.检测netplan配置

netplan try

Warning: Stopping systemd-networkd.service, but it can still be activated by:
  systemd-networkd.socket
Do you want to keep these settings?

Press ENTER before the timeout to accept the new configuration

Changes will revert in 97 seconds
Configuration accepted.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

按回车
ifconfig看看是否获取到IP,获取到IP网络恢复

3.重启服务器测试,网络正常

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/536784
推荐阅读
相关标签
  

闽ICP备14008679号