![Ubuntu 20.04 中缺少以太网接口](https://linux22.com/image/943082/Ubuntu%2020.04%20%E4%B8%AD%E7%BC%BA%E5%B0%91%E4%BB%A5%E5%A4%AA%E7%BD%91%E6%8E%A5%E5%8F%A3.png)
我在安装 Ubuntu 20.04 时遇到问题,没有以太网接口,我找不到恢复它的方法。我的情况与这问题,但我无法访问外部 NIC,我怀疑这对我来说是否可行。我有一个 USB wifi 适配器,但系统无法识别它,我无法构建驱动程序(当我尝试编译它们时,我收到编译错误)。当我进行此安装时,我选择了最小安装选项,这可能是 USB 适配器无法识别的原因。
任何帮助至少使以太网连接重新工作都将不胜感激。我花了很多时间来自定义此安装,如果可以避免,我宁愿不必重新完成所有工作。归根结底,我可以随时重新安装,但我想避免它。
背景
这个问题始于我的屏幕分辨率由于某些驱动程序问题而卡在 800x600。我以前修复过这个问题,但忘记了具体是怎么解决的,所以我用谷歌搜索了一下,尝试了几种解决方案,但都不起作用。我还有其他事情要处理,所以我放弃了这个问题,把电脑放了几个星期。当我再次处理这个问题时,我还注意到我不再有网络连接。在尝试了一些方法(我现在都不记得了)之后,更换了网线,换了新的主板、CPU 和 RAM(无论如何我都想升级,我想也许我使用的旧主板终于要坏了),我意识到还有其他问题。
我无法直接在机器上安装任何东西,我可以通过从另一台机器上下载它们及其依赖项、将它们放在 USB 上并从 USB 上安装它们来安装一些软件包。下面是我在其他线程中看到的一组命令的输出。
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
sudo lshw -C network
*-network UNCLAIMED
description: Ethernet controller
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:25:00.0
version: 15
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list
configuration: latency=0
resources: ioport:f000(size=256) memory:f7504000-f7504fff memory:f7500000-f7503fff
lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) I/O Memory Management Unit
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:01.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:03.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge
00:04.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:07.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:07.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 59)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7
03:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] Device 43bc (rev 02)
03:00.1 SATA controller: Advanced Micro Devices, Inc. [AMD] Device 43b8 (rev 02)
03:00.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b3 (rev 02)
20:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
20:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
20:06.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
20:07.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port (rev 02)
25:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
29:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)
29:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)
2a:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function
2a:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Platform Security Processor
2a:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Zeppelin USB 3.0 Host controller
2b:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Renoir PCIe Dummy Function
2b:00.2 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51)
2b:00.3 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) HD Audio Controller
cat /etc/netplan/01-netcfg.yaml
#Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
modinfo r8168
/modinfo r8169
这两个命令都会生成一个模块未找到消息
编辑
写完问题后,我尝试安装,dkms
一切r8168-dkms
正常,但我仍然没有网络连接。我相当确定我sudo modprobe r8169
此时尝试过,但可能没有。我还尝试了linux-generic-hwe-20.04
另一个问题中提到的安装,但由于一些错误而未能完成。
看到@Terrance的评论后,我决定再试sudo modprobe r8169
一次,结果成功了。要么是我之前没有运行命令,要么是我安装的尝试linux-generic-hwe-20.04
刚好能让驱动程序正常工作(我不确定这是否可行)。
最终结果是,我的系统运行良好,我应该能够修复它,但我不知道确切的修复方法,这让我更恼火