I have installed Ubuntu 20.04 on a new PC and originally managed to get the RTL8125 NIC driver working by installing the Realtek driver. However after an update it has stopped working and I am unable to get it working again.
I also downloaded the driver from the realtek website at -interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software but I had to connect my mobile phone via usb and share the internet connection with the desktop in order to download the 2.5G Ethernet LINUX driver r8125 for kernel up to 5.6
If you have a fresh install of Ubuntu, the build essentials ar not installed.And because build essentials is an meta-package, you could not download it and put it manualy per usb to ubuntu. But you need this package to build network-kernel-driver, especially you want to install uefi-supported driver.
I have selected all packages in the meta-package "build essential" put it in one folder together with the source-code of the network device.Then first I install all packages in this selected folder with command dpkg -i *.deb. If dpkg can not resolve dependiencies, then verify wich package is not installed , because of wrong installation order, then install missed package with dpkg -i package-name.deb and then repeat "dpkg -i *.deb", until all dependiencies are resolved.
Here's what I did to get the official Ubuntu driver working, supported on Ubuntu 20.04.3 and later (I did this on 20.04.5). Prior to this, I had been using the driver downloaded from RealTek, but ran into problems with it not working over time due to kernel changes causing it to not load, and forcing me to re-install it each time I updated the OS (or it did so automatically).
The 20.04.3+ driver does (I think) require the HWE kernel, which was also needed for the RealTek driver, so for me, I already had HWE installed, but see the offical docs on how to install it: LTS Enablement Stacks.
Important: If you previously had the RealTek r8125 driver, you may have been told to blacklist the r8169 driver. Check /etc/modprobe.d/ and see if you have the r8169 driver blacklisted - remove it if so, as it appears that this is the driver you need for things to work. (You'd think they'd alias the r8169 driver, but apparently not).
7fc3f7cf58