[硬件配置]记录Ubuntu 14.04 下安装无线网卡驱动解决无法连接WiFi的过程

新电脑安装了Ubuntu 14.04,但是网络连接中只有以太网而没有WiFi的选项.

打开System Setting系统设置-Software&Updates软件&更新-Additional Drivers附加驱动,无法加载出相应的驱动,更换为国内源也无法显示出相应的驱动.

打开Terminal使用命令查询网卡(hardware of Internet)状态

$ lshw -C network 

详细信息如下

*-network UNCLAIMED
description: Network controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:02:00.0
version: 10
width: 64 bits
clock: 33MHz
capabilities: cap_list
configuration: latency=0
resources: memory:df200000-df201fff
*-network
description: Ethernet interface
product: QCA8171 Gigabit Ethernet
vendor: Qualcomm Atheros
physical id: 0
bus info: pci@0000:03:00.0
logical name: eth0
version: 10
serial: **************
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=alx duplex=full ip=******** latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:128 memory:df100000-df13ffff ioport:d000(size=128)

有两部分,第一部分是无线网,第二部分是以太网.我们可以发现无线网被UNCLAIMED,而且源内也找不到相应的驱动,那么我们需要手动下载本电脑无线网卡的驱动然后安装.

首先我们需要查询电脑的无线网卡型号,Ubuntu下好像没有什么特别好的办法,在网上找到的如下命令

$ lspci | grep -i net

或者

$ iwconfig

如果是双系统的话,在Windows下控制面板-设备管理器中可以查到无线网卡具体型号,我的电脑无线网卡型号是Intel Dual Band Wireless-AC 3168.
然后我们去Intel的官网查找适用于Linux的无线网卡驱动,可以搜索 无线网卡型号+Ubuntu,然后找Intel的官方网站.这个网址适用于很多网卡型号:https://www.intel.com/content/www/us/en/support/articles/000005511/network-and-i-o/wireless-networking.html

在下载对应驱动的同时,我们发现驱动对Linux内核的版本有要求,由于Ubuntu 14.04的初始内核为4.4,而我的电脑无线网卡对应的内核为4.6+,因此我们需要更新内核.

首先查询一下自己的Ubuntu内核

$ uname -sr

然后打开http://kernel.ubuntu.com/~kernel-ppa/mainline/选择合适的版本下载,我选择4.8的内核

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8/linux-headers-4.8.0-040800_4.8.0-040800.201610022031_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8/linux-headers-4.8.0-040800-generic_4.8.0-040800.201610022031_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8/linux-image-4.8.0-040800-generic_4.8.0-040800.201610022031_all.deb

直接从网站上下载也可以,然后切换到下载路径下安装

$ sudo dpkg -i *.deb

安装完成后重启,然后检查Ubuntu内核是否更新过

$ uname -sr

接着把下载好的驱动复制到/lib/firmware中

$ sudo cp -i iwlwifi-3168-22.ucode /lib/firmware

接着更新一下grub,然后重启

$ sudo update-grub

$ sudo reboot

然后就大功告成啦,可以愉快地连WiFi上网了

上一篇:『NLP经典项目集』01:seq2vec是什么? 瞧瞧怎么用它做情感分析


下一篇:WPF学习之路(七)应用程序和窗口