Wifi works but Ethernet does not

Hello - I recently had to reinstall Zorin and decided to set up ethernet while i was at it. While doing this, i discovered that it will attempt to connect and then give up. It appears to be a driver issue. This is what i got

thomas@*******:~/Downloads$ lshw -c network 
WARNING: you should run this program as super-user.
  *-network                 
       description: Wireless interface
       product: Wi-Fi 6 AX201
       vendor: Intel Corporation
       physical id: 14.3
       bus info: pci@0000:00:14.3
       logical name: wlo1
       version: 00
       serial: 38:fc:98:d9:c8:53
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.15.0-67-generic firmware=66.f1c864e0.0 QuZ-a0-hr-b0-66.u ip=192.168.231.7 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: iomemory:600-5ff irq:16 memory:6013114000-6013117fff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: enp4s0
       version: 15
       serial: d8:bb:c1:20:72:6e
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.051.02-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:16 ioport:3000(size=256) memory:a1104000-a1104fff memory:a1100000-a1103fff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
thomas@*******:~/Downloads$ sudo lshw -c network 
[sudo] password for thomas:   
Sorry, try again.
[sudo] password for thomas:  
  *-network                 
       description: Wireless interface
       product: Wi-Fi 6 AX201
       vendor: Intel Corporation
       physical id: 14.3
       bus info: pci@0000:00:14.3
       logical name: wlo1
       version: 00
       serial: 38:fc:98:d9:c8:53
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.15.0-67-generic firmware=66.f1c864e0.0 QuZ-a0-hr-b0-66.u ip=192.168.231.7 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: iomemory:600-5ff irq:16 memory:6013114000-6013117fff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: enp4s0
       version: 15
       serial: d8:bb:c1:20:72:6e
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.051.02-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:16 ioport:3000(size=256) memory:a1104000-a1104fff memory:a1100000-a1103fff

thomas@*******:~/Downloads$ lspci -knnd ::0200
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
	Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1462:12f4]
	Kernel driver in use: r8168
	Kernel modules: r8168

Any help would be appreciated. I've tried installing their drivers from their website but:

thomas@*******~/Downloads/r8168-8.051.02$ sudo ./autorun.sh

Check old driver and unload it.
rmmod r8168
Build the module and install
Skipping BTF generation for /home/thomas/Downloads/r8168-8.051.02/src/r8168.ko due to unavailability of vmlinux
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
At main.c:167:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
Warning: modules_install: missing 'System.map' file. Skipping depmod.
DEPMOD 5.15.0-67-generic
load module r8168
Updating initramfs. Please wait.
update-initramfs: Generating /boot/initrd.img-5.15.0-67-generic
Completed.

Is that an ArchLinux-specific driver?

Listed in order of likelihood of success:

A driver from Realtek, good for kernels up to 5.19:
https://www.realtek.com/en/directly-download?downloadid=8a2ffcae711e2dfb96e6f33843bbdc08

A driver on GitHub:

Another driver on GitHub:

Intel has a backport driver:
sudo add-apt-repository ppa:canonical-hwe-team/pc-oem-dkms
sudo apt-get update
sudo apt-get install backport-iwlwifi-dkms
reboot

I don't recall the exact origin of that driver as i've downloaded a few solutions, but any one that i've downloaded was either advertised as for debian, ubuntu or all linux distros.

The first link takes me to a download page that does not give me a download

I've attempted the solution in the second link. Here are my results:

thomas@*******:~/Downloads$ sudo apt update && sudo apt install build-essential libelf-dev linux-headers-$(uname -r)
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease               
Hit:2 http://archive.canonical.com/ubuntu focal InRelease                      
Hit:3 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease             
Hit:4 https://packages.zorinos.com/stable focal InRelease                      
Hit:5 http://gu.archive.ubuntu.com/ubuntu focal InRelease                      
Hit:6 https://packages.zorinos.com/patches focal InRelease                     
Ign:7 https://repo.vivaldi.com/stable/deb stable InRelease                     
Hit:8 http://gu.archive.ubuntu.com/ubuntu focal-updates InRelease              
Hit:9 https://packages.zorinos.com/apps focal InRelease                        
Hit:10 https://repo.vivaldi.com/stable/deb stable Release                      
Hit:11 https://packages.zorinos.com/drivers focal InRelease         
Get:13 http://gu.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:14 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease         
Hit:15 https://packages.zorinos.com/premium focal InRelease                    
Hit:16 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease         
Hit:17 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease          
Fetched 108 kB in 3s (41.5 kB/s)                     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libelf-dev is already the newest version (0.176-1.1build1).
build-essential is already the newest version (12.8ubuntu1.1).
linux-headers-5.15.0-67-generic is already the newest version (5.15.0-67.74~20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
thomas@*******:~/Downloads$ git clone https://github.com/airium/Realtek-PCIe-GBE-NIC-Driver.git
Cloning into 'Realtek-PCIe-GBE-NIC-Driver'...
remote: Enumerating objects: 75, done.
remote: Total 75 (delta 0), reused 0 (delta 0), pack-reused 75
Unpacking objects: 100% (75/75), 232.53 KiB | 147.00 KiB/s, done.
thomas@*******:~/Downloads$ cd Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05
thomas@*******~/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05$ sudo sh autorun.sh

Check old driver and unload it.
Build the module and install
/home/thomas/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05/src/r8168_n.c:60:10: fatal error: linux/pci-aspm.h: No such file or directory
   60 | #include <linux/pci-aspm.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:297: /home/thomas/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05/src/r8168_n.o] Error 1
make[2]: *** [Makefile:1906: /home/thomas/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05/src] Error 2
make[1]: *** [Makefile:140: modules] Error 2
make: *** [Makefile:40: modules] Error 2

After figuring the note in step 1 may apply, i did the following:

thomas@*******:~/Downloads$ sudo dpkg -i linux-headers-6.3.0-060300rc3-generic_6.3.0-060300rc3.202303192130_amd64.deb 
(Reading database ... 290714 files and directories currently installed.)
Preparing to unpack linux-headers-6.3.0-060300rc3-generic_6.3.0-060300rc3.202303192130_amd64.deb ...
Unpacking linux-headers-6.3.0-060300rc3-generic (6.3.0-060300rc3.202303192130) over (6.3.0-060300rc3.202303192130) ...
dpkg: dependency problems prevent configuration of linux-headers-6.3.0-060300rc3-generic:
 linux-headers-6.3.0-060300rc3-generic depends on linux-headers-6.3.0-060300rc3; however:
  Package linux-headers-6.3.0-060300rc3 is not installed.
 linux-headers-6.3.0-060300rc3-generic depends on libc6 (>= 2.34); however:
  Version of libc6:amd64 on system is 2.31-0ubuntu9.9.
 linux-headers-6.3.0-060300rc3-generic depends on libssl3 (>= 3.0.0); however:
  Package libssl3 is not installed.

dpkg: error processing package linux-headers-6.3.0-060300rc3-generic (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-6.3.0-060300rc3-generic

thomas@*******:~/Downloads$ sudo apt -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  linux-headers-6.3.0-060300rc3-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 27.7 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 290714 files and directories currently installed.)
Removing linux-headers-6.3.0-060300rc3-generic (6.3.0-060300rc3.202303192130) ..
.

Step 3 yielded a similar result to step 2

and step 4 yielded the following:

thomas@*******:~/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05$ sudo add-apt-repository ppa:canonical-hwe-team/pc-oem-dkms
 This PPA contains final DKMS packages that are used for shipping on images and to users for various commercial PC OEM projects, including Somerville (Dell), Sutton (Lenovo) and Stella (HP).
 More info: https://launchpad.net/~canonical-hwe-team/+archive/ubuntu/pc-oem-dkms
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://archive.canonical.com/ubuntu focal InRelease                      
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease               
Ign:3 http://ppa.launchpad.net/canonical-hwe-team/pc-oem-dkms/ubuntu focal InRelease
Hit:4 https://packages.zorinos.com/stable focal InRelease                      
Ign:5 https://repo.vivaldi.com/stable/deb stable InRelease                     
Hit:6 http://gu.archive.ubuntu.com/ubuntu focal InRelease                      
Hit:7 https://packages.zorinos.com/patches focal InRelease                     
Hit:8 https://repo.vivaldi.com/stable/deb stable Release                       
Hit:9 https://packages.zorinos.com/apps focal InRelease                        
Hit:11 http://gu.archive.ubuntu.com/ubuntu focal-updates InRelease  
Hit:12 https://packages.zorinos.com/drivers focal InRelease         
Hit:13 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease 
Hit:14 https://packages.zorinos.com/premium focal InRelease                    
Get:15 http://gu.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]  
Hit:16 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease         
Hit:17 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease         
Hit:18 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease
Err:19 http://ppa.launchpad.net/canonical-hwe-team/pc-oem-dkms/ubuntu focal Release
  404  Not Found [IP: 185.125.190.52 80]
Reading package lists... Done                        
E: The repository 'http://ppa.launchpad.net/canonical-hwe-team/pc-oem-dkms/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
thomas@*******:~/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05$ sudo apt-get update
Hit:1 http://gu.archive.ubuntu.com/ubuntu focal InRelease                      
Hit:2 http://archive.canonical.com/ubuntu focal InRelease                      
Ign:3 http://ppa.launchpad.net/canonical-hwe-team/pc-oem-dkms/ubuntu focal InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease               
Hit:5 https://packages.zorinos.com/stable focal InRelease                      
Hit:6 http://gu.archive.ubuntu.com/ubuntu focal-updates InRelease              
Hit:7 https://packages.zorinos.com/patches focal InRelease                     
Ign:8 https://repo.vivaldi.com/stable/deb stable InRelease                     
Hit:9 https://packages.zorinos.com/apps focal InRelease                        
Get:10 http://gu.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]  
Hit:11 https://repo.vivaldi.com/stable/deb stable Release                      
Hit:13 https://packages.zorinos.com/drivers focal InRelease                    
Hit:14 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease            
Hit:15 https://packages.zorinos.com/premium focal InRelease                    
Hit:16 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease         
Hit:17 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease         
Hit:18 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease
Err:19 http://ppa.launchpad.net/canonical-hwe-team/pc-oem-dkms/ubuntu focal Release
  404  Not Found [IP: 185.125.190.52 80]
Reading package lists... Done                        
E: The repository 'http://ppa.launchpad.net/canonical-hwe-team/pc-oem-dkms/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
thomas@*******:~/Downloads/Realtek-PCIe-GBE-NIC-Driver/r8168-8.047.05$ sudo apt-get install backport-iwlwifi-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  backport-iwlwifi-dkms
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,568 kB of archives.
After this operation, 10.0 MB of additional disk space will be used.
Get:1 http://gu.archive.ubuntu.com/ubuntu focal-updates/universe amd64 backport-iwlwifi-dkms all 8324-0ubuntu3~20.04.5 [1,568 kB]
Fetched 1,568 kB in 3s (469 kB/s)                  
Selecting previously unselected package backport-iwlwifi-dkms.
(Reading database ... 280667 files and directories currently installed.)
Preparing to unpack .../backport-iwlwifi-dkms_8324-0ubuntu3~20.04.5_all.deb ...
Unpacking backport-iwlwifi-dkms (8324-0ubuntu3~20.04.5) ...
Setting up backport-iwlwifi-dkms (8324-0ubuntu3~20.04.5) ...
Loading new backport-iwlwifi-8324 DKMS files...
Building for 5.15.0-67-generic
Building initial module for 5.15.0-67-generic
yError!  The /var/lib/dkms/backport-iwlwifi/8324/5.15.0-67-generic/x86_64/dkms.conf for module backport-iwlwifi includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Skipped.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.