Score:1

How do I install a downloaded driver?

de flag

I have a StarTech network card (details below) but don't see how to install it. After downloading the zip file and extracting, there's a Makefile file and a src folder. The readme is useless for Windows only. Makefile lists some incomplete hints at how to install. How do?

Note: sudo apt update, sudo apt upgrade, sudo reboot did not pickup the driver. The network card has a network cable plugged in with lights flashing.

Download Contents:

user@hostname:~/Desktop/r8169-6.011.00$ ls
Makefile  readme  src 

From Makefile:

all: clean modules install

modules:
    $(MAKE) -C src/ modules

clean:
    $(MAKE) -C src/ clean
                                                                                                                             
install:
    $(MAKE) -C src/ install

Network Card Info:
1-Port PCI Gigabit Ethernet Network Card
Part # ST1000BT32
Support Webpage: https://www.startech.com/en-us/networking-io/st1000bt32
Driver Download: https://sgcdn.startech.com/005329/media/sets/realtek_Gigabit_linux-unix-novel_Drivers/[Realtek]%20Linux-Unix-Novell%20Gigabit%20PCI%20Network%20Card.zip

cocomac avatar
cn flag
What happens when you run `make && make install`? You may have to run `make install` with `sudo` (`make && sudo make install`). That might work.
conman253 avatar
de flag
It appears the command `make` is intended to be used here. It's not working for me but that may be an incompatibility issue with the older MSI system board `MS-7522`. adding the `-C src/ install` did not seem to matter and `sudo make install` from the directory seemed to find the src folder on it's own.
guiverc avatar
cn flag
You've not provided any OS & release details; nor if using a LTS release which kernel stack you're using; as *drivers* are actually kernel modules; the stack chosen may influence requirements. I don't see the chipset details provided in the page you provided, but I'd still not expect any kernel modules to be needed for most releases; but you gave no specific details (what *chipset* is on the card; your paste implies it's r8169; and what OS/release are you using?)
Terrance avatar
id flag
The `readme` file gives you full instructions on how to install that driver.
mchid avatar
bo flag
Please provide your version of Ubuntu. Also, please provide the output of the following commands: `lsmod | grep r816` and `uname -rv`
mchid avatar
bo flag
I found an updated version of this driver directly from Realtek but I believe it's only good through kernel 5.6 and not beyond. Also, if the kernel driver works fine, it might not be necessary to install this driver (the default driver may run better). However, it has a complete and accurate readme. The make sequence is slightly different. First, disable the kernel module: `sudo rmmod r8169` then run the make sequence: `sudo make clean modules` then `sudo make install` then `sudo depmod -a` then `sudo modprobe r8169`
Score:2
bo flag

The download you provided is listed as the r8169 driver. The Realtek r8169 module is provided by the default linux kernel (it's pre-installed).

First, run the following command to check if the module is in use:

lsmod | grep r816

If the module is listed, you are done. Use the next step to list your devices. If the module is not listed, proceed to the next step and then continue.

Next, run the following command to list your current devices:

ifconfig -a

Then, use the following commands to enable the kernel module (driver) and to list your devices:

sudo modprobe  r8169
ifconfig -a

Finally, you should see an additional ethernet device listed.


############################################################

METHOD 2:

Use the following method if the default driver doesn't work:

If you have problems with the kernel module, you can download the driver directly from Realtek.

Click here to visit the website

Select "GBE Ethernet LINUX driver r8169 for kernel up to 5.6" to download.

Then, install the dependencies:

sudo apt update
sudo apt install build-essential linux-headers-generic linux-headers-$(uname -r)

Next, cd into the same directory as the download and then run the following commands:

mkdir r8169
cd r8169
tar xvf ../r8169*bz2 --strip-components 1

If you get a "not found" error for the following command, just ignore and proceed.

sudo modprobe -r r8169
sudo make clean modules
sudo make install
sudo depmod -a
sudo modprobe r8169

Check to see if the module is loaded:

lsmod | grep r8169

List your devices:

ifconfig -a

############################################################

The drawback of installing the driver manually is that you will have to reinstall the driver after any future kernel update.

Otherwise, you will need to use the following instructions to manually update the driver.

After you boot up using a new kernel, cd back into your r8169 directory and then run the following commands:

sudo modprobe -r r8169
sudo make clean
sudo make clean modules
sudo make install
sudo depmod -a
sudo modprobe r8169

However, as mentioned by @Terrance, you can avoid this problem by converting the driver to DKMS which will automatically install during future updates.

When following the instructions, don't forget to use the corresponding driver name r8169 and also the correct version number of your downloaded driver.

Terrance avatar
id flag
Good solid answer! +1 You can however, convert a downloaded driver into DKMS. https://askubuntu.com/a/1334101/231142
mchid avatar
bo flag
Awesome. I knew that was possible but never took the time to learn or figure it out.
mchid avatar
bo flag
Upon further inspection, it appears the downloaded version exactly matches the kernel version.
mchid avatar
bo flag
The `dkms.conf` file also needs some tweaking for this one. Again, the kernel version exactly matches this so it isn't necessary to use dkms for this but for a different version, it might help to use `/usr/bin/make` instead of `make` in the `dkms.conf` file.
mchid avatar
bo flag
Also, since the instructions for this uses `make clean modules` you would have to use `/usr/bin/make -C usr/ modules` for `MAKE` and do the same for `CLEAN`
Terrance avatar
id flag
Feel free to use my instructions there and change them as need be to match the driver here. I think it would be cool!
mchid avatar
bo flag
@Terrance This one is `r8169` and I think the make sequence is completely different than `r8168`. In this one, the main makefile links the commands to a `build` script. It's kind of weird compared to other realtek sources I've seen.
Terrance avatar
id flag
Well, I have a file server here that has both a r8168 and r8169 in it. I could test it out and see how well it works for dkms carry over. I do have to run a fix on it after kernel updates because it will bind the r8168 card to the r8169 driver since it is still there and not blacklisted.
mchid avatar
bo flag
@Terrance The thing is that it really doesn't make a difference with the r8169 driver because after you build it, it states: `good news! the kernel version in use is the exact same version so the built version will not be used . . .` or something similar.
Terrance avatar
id flag
OK, fair enough. :)
mchid avatar
bo flag
@Terrance I might check out the r8168 and see what happens though.
Terrance avatar
id flag
You'll have to let me know. I am lovin the r8168 driver on my RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller as when I was using the r8169 for no reason whatsoever, the network would die, I would then have to actually hard power cycle my tower by killing all power to it. Then the NIC would work again for a while. Ever since going with the actual r8168 driver and blacklisting the r8169, no issues whatsoever. :)
Score:0
pt flag

Why do you want to install something? In-tree kernel driver r8169 supports this card out of the box. There may just be the situation that your distro uses r8168 for RTL8168 PCIe cards and has r8169 blacklisted. Then manually check with a "modprobe r8169" and remove the blacklisting afterwards.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.