Linux下无线网卡驱动异常解决办法

查看本机无线网卡型号:lspci | grep Network    本机型号是RTL8723BE

在 https://github.com/lwfinger/rtlwifi_new 找到自己对应型号的驱动

Linux下无线网卡驱动异常解决办法_第1张图片

阅读README.md 

rtlwifi_new
A repo for the newest Realtek rtlwifi codes.

This code will build on any kernel 4.2 and newer as long as the distro has not modified any of the kernel APIs. IF YOU RUN UBUNTU, YOU CAN BE ASSURED THAT THE APIs HAVE CHANGED. NO, I WILL NOT MODIFY THE SOURCE FOR YOU. YOU ARE ON YOUR OWN!!!!!

It includes the following drivers:

rtl8192ce, rtl8192cu, rtl8192se, rtl8192de, rtl8188ee, rtl8192ee, rtl8723ae, rtl8723be, and rtl8821ae.

If you are looking for the driver for rtl8822be or rtl8723de, then execute the following command:

git checkout origin/extended -b extended
Installation instruction

You can find <> using lspci | grep Wireless. Afterwards, execute the following lines of codes in your shell:

You will need to install "make", "gcc", "kernel headers", "kernel build essentials", and "git".

If you are running Ubuntu, then

 sudo apt-get install linux-headers-generic build-essential git

Please note the first paragraph above.

For all distros:
git clone https://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
sudo make install
sudo modprobe -r <>
sudo modprobe <>

#### Option configuration
If it turns out that your system needs one of the configuration options, then do the following:

vim /etc/modprobe.d/<>.conf 

There, enter the line below:
`options <> <>=`

首先知道要内核版本至少要4.2版本(uname -r查看内核版本),若不符合要求则需要编译内核。

下载内核源码并解压进入源码安装包 推荐下载地址 https://www.kernel.org/ 找到合适版本的内核下载,我用的是4.4.126。

Linux下无线网卡驱动异常解决办法_第2张图片

下载完成后执行下面命令

tar xvf linux-4.4.126.tar.xz -C /usr/src/kernels/ && cd /usr/src/kernels/linux-4.4.126
make oldconfig        //会出现很多选项,选择默认
make bzImage && make modules && make modules_install && make install     //等待编译安装完成
cat /boot/grub2/grub.cfg | grep menuentry        //查看系统可用内核
grub2-set-default 'Red Hat Enterprise Linux Server (4.4.126) 7.2 (Maipo)'    //修改开机默认使用的内核

执行完毕后重启即可。编译过程可参考https://blog.csdn.net/GuoQiiang/article/details/75810075

继续进入到要安装目录执行 make,若make出错

错误内容:“make: * /lib/modules/2.6.32-431.el6.x86_64/build:没有那个文件或目录”
-安装kernel-header和kernel-devel 解决错误     //kernel-header和kernel-devel可在 https://pkgs.org/ 上找到
-重新make
-make完成执行 make install
-最后执行 modprobe rtl8723be
注意:以上命令要在root用户下执行
然后重启系统你会发现你的无线网卡已经可以用了

你可能感兴趣的:(Linux下无线网卡驱动异常解决办法)