Wifi driver after kernel upgrade

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
skomo
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 2:59 am

Wifi driver after kernel upgrade

Post by skomo »

Hi all, linux noob here.
I bought a wifi ac chinese usb dongle sporting a Realtek rtl8821cu chip, found a working driver, and installed via

Code: Select all

make
sudo make install
sudo modprobe 8821cu
It worked perfectly since yesterday when i updated the kernel to 4.15.0-36, than rebooted and.... no wifi.
i tried to reinstall the driver via

Code: Select all

make
sudo make install
sudo modprobe 8821cu
And now it works again.

The questions are:

1- I need to reinstall the driver every kernel update?
2- If yes, i always need to make and install or i can simply "modprobe" or something else?

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Current Machine ==> Matebook D13 2020 Linux Mint 20 5.8.0-29-generic
Ryzen 5 3500U with Vega 8 graphics

Previous Machine ==> Linux Mint 19.3 5.3.0-26-generic
AMD E2-6110 with R2 graphics (i loved it!)
User avatar
AZgl1800
Level 20
Level 20
Posts: 11146
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Wifi driver after kernel upgrade

Post by AZgl1800 »

JeremyB will help you fix it,
he did for me.
I had the same problems, had to reinstall with each new kernel.

JeremyB wrote a special script just for me, and mine is good now.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Wifi driver after kernel upgrade

Post by JeremyB »

Where is the source code from?
User avatar
skomo
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 2:59 am

Re: Wifi driver after kernel upgrade

Post by skomo »

Hi, i found this driver on github https://github.com/whitebatman2/rtl8821CU

I haven't understand if i need to make, make install then modprobe everytime i upgrade the kernel or i can only modprobe or similar..
Current Machine ==> Matebook D13 2020 Linux Mint 20 5.8.0-29-generic
Ryzen 5 3500U with Vega 8 graphics

Previous Machine ==> Linux Mint 19.3 5.3.0-26-generic
AMD E2-6110 with R2 graphics (i loved it!)
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Wifi driver after kernel upgrade

Post by JeremyB »

Since that source code has no dkms.conf file, the make, sudo make install commands will be needed after kernel updates but if you want to a dkms.conf file can be created in the rtl8821CU folder

Code: Select all

xed ~/rtl8821CU/dkms.conf
Use this for contents

Code: Select all

PACKAGE_NAME="rtl8821cu"
PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME="8821cu"
DEST_MODULE_LOCATION="/kernel/drivers/net/wireless/"
REMAKE_INITRD="yes"
AUTOINSTALL="yes"
MAKE="'make' all KVER=${kernelver}"
CLEAN="make clean"
Save and exit text editor, then in terminal

Code: Select all

cd
sudo apt install dkms
sudo dkms add rtl8821CU
sudo dkms install rtl8821cu/1.0
Then it should compile during the install of a new kernel automatically
User avatar
skomo
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 2:59 am

Re: Wifi driver after kernel upgrade

Post by skomo »

Thanks a lot man, you are great! I'll give a try.
I would not have known where to start.

What to do if i want to remove this script to install the driver automatically?

P.S. now i need to "study" what DKMS is.
Current Machine ==> Matebook D13 2020 Linux Mint 20 5.8.0-29-generic
Ryzen 5 3500U with Vega 8 graphics

Previous Machine ==> Linux Mint 19.3 5.3.0-26-generic
AMD E2-6110 with R2 graphics (i loved it!)
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Wifi driver after kernel upgrade

Post by JeremyB »

Code: Select all

sudo dkms remove rtl8821cu/1.0 --all
Will remove the dkms for the module
User avatar
skomo
Level 1
Level 1
Posts: 33
Joined: Mon Dec 18, 2017 2:59 am

Re: Wifi driver after kernel upgrade

Post by skomo »

Yesterday i upgraded the kernel, and your script worked perfectly. I'm impressed with how powerful linux can be if you know enough of it.
Current Machine ==> Matebook D13 2020 Linux Mint 20 5.8.0-29-generic
Ryzen 5 3500U with Vega 8 graphics

Previous Machine ==> Linux Mint 19.3 5.3.0-26-generic
AMD E2-6110 with R2 graphics (i loved it!)
Locked

Return to “Networking”