How to have network device driver r8168 installed automatically when a new kernel is installed

8,586

You can install a dkms package with r8168 driver from official Ubuntu repositories.

You will need to uninstall the driver you have installed manually, then run in terminal:

sudo apt-get install r8168-dkms

The dkms package will rebuild the kernel module (driver) each time you upgrade a kernel.

The repository for Ubuntu 14.04 contains a dkms r8168 version 8.037.00-1.

It may work OK. But if you really need the latest driver, you can install it by:

wget http://mirrors.kernel.org/ubuntu/pool/universe/r/r8168/r8168-dkms_8.040.00-1_all.deb
sudo dpkg -i r8168-dkms_8.040.00-1_all.deb

That will install the same version that you are using now but with dkms support.

Share:
8,586

Related videos on Youtube

maddentim
Author by

maddentim

Updated on September 18, 2022

Comments

  • maddentim
    maddentim over 1 year

    I am using Ubuntu 14.04 LTS on my desktop and am using the integrated Realtek ethernet networking on my Gigabyte motherboard. Unfortunately, the device does not work after a new linux kernel is installed. I found a device driver that works, but I have to install it manually each time. I just open a terminal, navigate to the folder with the driver and do a

    sudo sh autorun.sh
    

    and it works again. Not the end of the world, but a bit inconvenient. The driver is r8168-8.040.00

    Is there a way that I can set it up so that the driver is install when the kernel is installed? Thanks!

    • chili555
      chili555 over 8 years
      Please edit your question to add details of your device from the terminal: lspci -nn | grep 0200
    • maddentim
      maddentim over 8 years
      My lspci -nn | grep 0200 = 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
  • maddentim
    maddentim over 8 years
    Sounds very promising. How do I uninstall the manually installed driver. And if I uninstall the driver will I be able to install r8168-dkms package without a working ethernet? Do I need to download the packages in advance? Or can I just run your last dpkg command to install the dkms package and then let it do its thing when the next kernel comes around? Thanks!
  • Pilot6
    Pilot6 over 8 years
    It depends on how you installed the driver. sudo make uninstall should work from the source directory. You can install dkms package first and download the r8168-dkms first. But if you uninstall it and do not reboot, the network should keep working.
  • maddentim
    maddentim over 8 years
    sudo make uninstall returned make: *** No rule to make target 'uninstall'. Stop. So I just wget'ed the .deb file and the next time I get a new kernel I'll install the r8168-dkms then. Thanks!
  • Pilot6
    Pilot6 over 8 years
    Where did you run sudo make uninstall from? How did you previously install it?
  • maddentim
    maddentim over 8 years
    I ran the uninstall from the driver's folder on my file system. Same one that I ran it's autorun.sh script that came with the driver. I just run sudo sh autorun.sh
  • Pilot6
    Pilot6 over 8 years
    You need to look into that script to see what it does.
  • maddentim
    maddentim over 8 years
    Thanks for your help. A new kernel popped up today and I installed the r8168-dkms_8.040.00-1_all.deb package and when the system rebooted the ethernet was working!