5

I have purchased a new desktop and I am trying to run Ubuntu in dual boot with windows 10. I have disabled secure boot and windows fast boot. When I log in to Ubuntu it does not connect to internet via ethernet cable.

sudo lshw -C network Shows realtek driver is unclaimed.

The solution I have searched is to install r8125 driver but I just cannot get the steps accurately. Request to let me know what are the installation steps of installing r8125 driver and run the internet from ethernet cable.

4 Answers4

20

To avoid having to reinstall the driver after every kernel update, create a file called dkms.conf in the NIC's source directory with these lines:

PACKAGE_NAME="r8125"
PACKAGE_VERSION="9.003.05"
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="YES"
REMAKE_INITRD="YES"
CLEAN="rm src/@PKGNAME@.ko src/*.o || true"

Modify 9.003.05 to the version number that you have the source code for. To install the driver for the first time:

sudo cp -R /path.to/source/ /usr/src/r8125-9.003.05
sudo dkms add -m r8125 -v 9.003.05
sudo dkms build -m r8125 -v 9.003.05
sudo dkms install -m r8125 -v 9.003.05

To update the version, remove the current one first, remembering to change to the correct version number:

sudo dkms remove r8125/9.002.02 --all
sudo rm -rf /usr/src/r81259.002.02/
sudo dkms status

After the first install, dkms will automatically build and install the driver for you. You will, of course, need dkms installed first.

nospam
  • 422
5

Somehow stuff breaks if I use the config from @nospam. The following config works for the newest versions, I added the kernelver to the build

$ cat dkms.conf
PACKAGE_NAME="realtek-r8125"
PACKAGE_VERSION="9.005.01"
BUILT_MODULE_NAME[0]="r8125"
DEST_MODULE_LOCATION[0]="/updates"
BUILT_MODULE_LOCATION[0]="src"
MAKE="'make' KVER=${kernelver} BSRC=/lib/modules/${kernelver} all"
AUTOINSTALL="yes"
REMAKE_INITRD="yes"
CLEAN="rm src/@PKGNAME@.ko src/*.o || true"

Or upgrade to the latest version of ubuntu worked for me

Martijn van Wezel
  • 903
  • 1
  • 7
  • 13
4
  • Obtain file from Realtek here (They make it very complicated :-( )
  • Unzip
  • In terminal, change into directory and run sudo ./autorun.sh
Ari Fordsham
  • 143
  • 5
0

I found that upgrading to Ubuntu 20.04 is another solution. I have a brand new B550 board and the existing Ubuntu 18.04 installation didn't pick up the 2.5G ethernet, but upgrading to 20.04 solved it for me.

robvdl
  • 83