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.