我之前运行的是 16.04 LTS(32 位),并决定升级到 20.04 LTS。我移除了装有 16.04 的驱动器并安装了新的 SSD。我通过 DVD 从下载的 iso 进行安装。安装后我重新启动,但没有网络。以太网控制器未显示在网络设置下。如果我运行 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:03:00.0
version: 3
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd cap_list
configuration: latency=0
resources: ioport:ce00(size=256) memory:fdfff000-fdffffff memory:fdff8000-fdffbfff memory:fd400000-fd41ffff
电缆已插入,PC 和路由器上的适配器均亮起。我尝试重新安装,但问题仍然存在。它与 16.04 配合良好,唯一不同的是新的 SSD 和新的操作系统。我对 Linux 不太熟悉 - 只是一名用户。任何帮助都将不胜感激。谢谢。
$ lsmod
Module Size Used by
nls_iso8859_1 16384 1
snd_hda_codec_realtek 118784 1
snd_hda_codec_generic 81920 1 snd_hda_codec_realtek
ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_codec_hdmi 61440 1
snd_usb_audio 258048 1
snd_usbmidi_lib 36864 1 snd_usb_audio
snd_hda_intel 53248 4
snd_intel_dspcfg 24576 1 snd_hda_intel
snd_hda_codec 131072 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core 90112 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep 20480 2 snd_usb_audio,snd_hda_codec
edac_mce_amd 32768 0
uvcvideo 98304 0
videobuf2_vmalloc 20480 1 uvcvideo
joydev 24576 0
input_leds 16384 0
snd_seq_midi 20480 0
videobuf2_memops 20480 1 videobuf2_vmalloc
snd_seq_midi_event 16384 1 snd_seq_midi
kvm_amd 98304 0
videobuf2_v4l2 24576 1 uvcvideo
snd_rawmidi 36864 2 snd_seq_midi,snd_usbmidi_lib
videobuf2_common 49152 2 videobuf2_v4l2,uvcvideo
ccp 86016 1 kvm_amd
videodev 225280 3 videobuf2_v4l2,uvcvideo,videobuf2_common
kvm 663552 1 kvm_amd
radeon 1474560 10
mc 53248 5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
snd_pcm 106496 5 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_hda_core
ttm 106496 1 radeon
snd_timer 36864 2 snd_seq,snd_pcm
wmi_bmof 16384 0
drm_kms_helper 184320 1 radeon
serio_raw 20480 0
i2c_algo_bit 16384 1 radeon
fb_sys_fops 16384 1 drm_kms_helper
k10temp 16384 0
snd 90112 23 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi
syscopyarea 16384 1 drm_kms_helper
soundcore 16384 1 snd
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
mac_hid 16384 0
sch_fq_codel 20480 1
parport_pc 40960 0
ppdev 24576 0
lp 20480 0
parport 53248 3 parport_pc,lp,ppdev
drm 491520 6 drm_kms_helper,radeon,ttm
ip_tables 32768 0
x_tables 40960 1 ip_tables
autofs4 45056 2
uas 28672 0
usb_storage 77824 1 uas
hid_logitech_hidpp 40960 0
hid_logitech_dj 24576 0
hid_generic 16384 0
usbhid 57344 1 hid_logitech_dj
hid 131072 4 usbhid,hid_generic,hid_logitech_dj,hid_logitech_hidpp
pata_acpi 16384 0
pata_jmicron 16384 0
firewire_ohci 40960 0
i2c_piix4 28672 0
firewire_core 65536 1 firewire_ohci
crc_itu_t 16384 1 firewire_core
realtek 24576 0
ahci 40960 2
pata_atiixp 16384 0
libahci 32768 1 ahci
wmi 32768 1 wmi_bmof
floppy 81920 0
$ dmesg | egrep -i 'eth|net|r816|error|fail'
[ 0.193357] NET: Registered protocol family 16
[ 0.193357] audit: initializing netlink subsys (disabled)
[ 0.206387] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206392] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206395] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206398] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206407] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206410] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206413] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206415] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206424] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206426] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206429] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206432] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206440] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206443] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206446] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206449] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206457] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206460] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206463] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206466] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206474] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206477] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206480] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206483] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206491] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206494] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206497] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206500] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206508] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206511] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206514] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206516] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206525] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.206528] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206530] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206533] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206541] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKA (20190816/dspkginit-438)
[ 0.206544] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKB (20190816/dspkginit-438)
[ 0.206547] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
[ 0.206550] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKD (20190816/dspkginit-438)
[ 0.226588] NetLabel: Initializing
[ 0.226589] NetLabel: domain hash size = 128
[ 0.226589] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO
[ 0.226602] NetLabel: unlabeled traffic allowed by default
[ 0.248324] NET: Registered protocol family 2
[ 0.249337] NET: Registered protocol family 1
[ 0.249341] NET: Registered protocol family 44
[ 0.873227] i8042: Failed to disable AUX port, but continuing anyway... Is this a SiS?
[ 1.129168] drop_monitor: Initializing network drop monitor service
[ 1.129307] NET: Registered protocol family 10
[ 1.136569] NET: Registered protocol family 17
[ 1.136850] RAS: Correctable Errors collector initialized.
[ 1.243699] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 1.246892] libphy: r8169: probed
[ 1.246894] r8169 0000:03:00.0: realtek.ko not loaded, maybe it needs to be added to initramfs?
[ 1.272769] r8169: probe of 0000:03:00.0 failed with error -49
[ 3.653707] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro
[ 5.357098] audit: type=1400 audit(1590039568.703:12): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=595 comm="apparmor_parser"
[ 5.357579] audit: type=1400 audit(1590039568.703:13): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=595 comm="apparmor_parser"
[ 98.557314] audit: type=1107 audit(1590039661.903:1562): pid=674 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/NetworkManager" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.13" pid=3278 label="snap.snap-store.ubuntu-software" peer_pid=675 peer_label="unconfined"
[12157.551604] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[12157.554165] libphy: r8169: probed
[12157.554167] r8169 0000:03:00.0: realtek.ko not loaded, maybe it needs to be added to initramfs?
[12157.572403] r8169: probe of 0000:03:00.0 failed with error -49
[13125.601531] blk_update_request: I/O error, dev sdd, sector 264544 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13125.601542] Buffer I/O error on dev sdd2, logical block 44, lost async page write
[13125.601562] blk_update_request: I/O error, dev sdd, sector 6555656 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13125.601567] Buffer I/O error on dev sdd2, logical block 786433, lost async page write
[13125.872264] sd 9:0:0:0: [sdd] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[13202.988262] sd 9:0:0:0: [sdd] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
$ ifconfig -a
Command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools
$ sudo apt install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package net-tools
答案1
r8168 驱动程序包含在 Ubuntu 存储库中,因此您不需要自己编译它,所以首先尝试以下操作:
sudo rmmod r8169 r8168
sudo apt-get purge r8168-dkms
sudo modprobe r8169
dmesg | egrep -i 'eth|net|r816'
ifconfig -a
如果 modprobe 没有报告错误或在 dmesg 中没有发现错误,那么您应该在 ifconfig 输出中看到一个以太网设备(除了 lo 设备)。
如果没有,请尝试 r8168 驱动程序:
sudo rmmod r8169
sudo apt-get install r8168-dkms
sudo modprobe r8168
dmesg | egrep -i 'eth|net|r816'
ifconfig -a
如果仍然没有以太网设备,请添加以下输出:
find /lib -name r816\*
lsmod
dmesg | egrep -i 'eth|net|r816|error|fail'
ifconfig -a
对于原始问题。
答案2
事实证明这是主板的一个已知问题:
https://bugs.launchpad.net/ubuntu/+source/linux-signed/+bug/1876593
通过将 BIOS 升级到最新版本并按照错误报告中的建议打开 LAN Boot 选项,问题得以解决。感谢 Wayne Vosberg。
答案3
当我在 Realtek 8168/8169 上没有互联网时,这个可以修复它:
sudo apt install r8168-dkms
reboot