r8168/r8169 RealTek driver module troubles

From the comments...

Using r8168-dkms 8.041.00 with the newer 4.15 kernel on Ubuntu 16.04 LTS won't work. You'll probably need 8.045.

The bionic version, r8168-dkms 8.045.08-2 from https://packages.ubuntu.com/search?keywords=r8168-dkms wouldn't compile. The cosmic -3 version would have probably worked fine.

r8168-dkms 8.045.08-3 from http://mirrors.edge.kernel.org/ubuntu/pool/universe/r/r8168/ works fine.

The system is operational now.

Note: kernel 4.15.0-24-generic has some known issues. Best to use another kernel if other problems arise.

Update #1:

r8168-dkms 8.046.00-1 has become available at http://mirrors.edge.kernel.org/ubuntu/pool/universe/r/r8168/r8168-dkms_8.046.00-1_all.deb

Update #2: (August 2019)

r8168-dkms_8.047.02-1 is now available at here.


Here's what worked for me under Linux Mint 19.2

  1. Grab a copy of the latest r8168 driver (or download it via another computer and put it on USB storage)

     wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/r/r8168/r8168-dkms_8.047.02-1_all.deb
    
  2. Install that driver (will automatically regenerate initramfs kernel image with integrated driver)

     dpkg -i r8168-dkms_8.047.02-1_all.deb
    
  3. Remove elder driver, blacklist it, and use newer one

     rmmod r8169
     echo "blacklist r8169" | sudo tee -a /etc/modprobe.d/blacklist.conf
     modprobe r8168
    
  4. Profit (and try if everything works after a fresh boot)