Just a couple of days ago Ubuntu 13.04 was released, so I decided to upgrade from 12.10 and realised that my network card is not working with the new 3.8.0-19 kernel. So I tried re-installing the Realtek driver which I had downloaded from their web site and it failed to install! So I did some searching over the Internet and found that someone had written a patch file to fix the driver.

First you will need to download the current r8168-8.035.00 driver from Realtek and extract it to your local folder:

$tar -xjf r8168-8.035.00.tar.bz2

Now download the r8168-8.035.00.patch file and save it the r8168-8.035.00 folder.

From the terminal change to the directory where you have extracted the folder:

$ cd r8168-8.035.00

In the driver’s folder enter the following command run the patch file:

r8168-8.035.00$ patch -p1 < r8168-8.035.00.patch

After the patch is complete, run the shell script to install the patched driver:

r8168-8.035.00$ sudo ./autorun.sh

That’s it you’re all done!