Maintaining Compiled Linux Driver Updates for Realtek 5Gb Network Adapter on Debian and NixOS
If you have built a new PC with an AMD 870 chipset and found that the Realtek 5Gb network adapter is not supported out-of-the-box on Debian and NixOS distributions, you have come to the right place. This article will guide you through the process of compiling and installing the latest Linux drivers for your Realtek 5Gb network adapter.
Subtitle 1: Identifying the Network Adapter
Before proceeding, it is essential to identify the exact model of your Realtek network adapter. You can use the following command to identify the device:
lspci -nn | grep 0200
This command will display the PCI devices connected to your system that match the Ethernet controller device classification (i.e., 0200). Look for the Realtek device in the list, and take note of the device ID (e.g., 10ec:8168).
Subtitle 2: Obtaining the Linux Driver Source Code
Once you have identified the network adapter, you can proceed to obtaining the Linux driver source code from the Realtek website. Follow these steps:
- Visit the Realtek Download Center.
- Search for your network adapter by typing the device ID into the search box.
- Download the latest Linux driver for your device.
Once you have downloaded the driver source code, extract it.
Subtitle 2.1: Extracting the Linux Driver Source Code
tar -xvf r8168-xxxx.tar.bz2
Replace r8168-xxxx.tar.bz2 with the filename of the driver source code archive you downloaded.
Subtitle 3: Compiling the Linux Driver
After extracting the source code, proceed to compile the Linux driver by executing the following commands:
cd r8168-xxxx/
make
Replace r8168-xxxx with the extracted source code directory name.
Subtitle 4: Installing the Compiled Linux Driver
After compiling the Linux driver, install it by executing the following commands:
sudo make install
sudo depmod
Subtitle 5: Verifying the Installation
To verify that the Linux driver has been installed correctly, execute the following command:
lsmod | grep r8168
The command should display the r8168 module in the list of loaded kernel modules, indicating that the driver is operational.
Subtitle 6: Persisting the Driver Across Reboots
To ensure that the driver persists across reboots, you can create a module alias in the /etc/modprobe.d/ directory by executing the following command:
sudo sh -c "echo 'alias net-pf-10 r8168' >> /etc/modprobe.d/realtek.conf"
This will ensure that the r8168 module is loaded at boot time.
Identify the Realtek network adapter by executing the
lspcicommand.Obtain the Linux driver source code from the Realtek website.
Extract the Linux driver source code archive.
Compile the Linux driver by executing the
makecommand.Install the compiled Linux driver by executing the
sudo make installandsudo depmodcommands.Verify the installation by executing the
lsmodcommand.Create a module alias to ensure the driver persists across reboots.