ubuntu不论什么版本,如果想要正常使用wifi,必须在电脑的bios中把secure boot设定为disable
rfkill list all
0: hci0: Bluetooth 这个是我电脑的蓝牙
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN 这个是我电脑内的网卡
Soft blocked: no
Hard blocked: no
2: phy1: Wireless LAN这个是插到电脑上的usb网卡
Soft blocked: no
Hard blocked: no
拔掉usb网卡后显示:
网上人有说联想电脑出现Hard blocked: yes,可以在终端输入:sudo modprobe -r ideapad_laptop
,参考可能解决方案;
lspci
这里的
00:14.3 Network controller: Intel Corporation Device 06f0 这个是网卡型号
00:15.0 Serial bus controller [0c80]: Intel Corporation Device 06e8 这个是有线网卡型号
或者
lspci -nnk | grep -i net
这里的
00:14.3 Network controller [0280]: Intel Corporation Device [8086:06f0] 这个是网卡型号
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
[10ec:8168] (rev 15) 这个是有线网卡型号
lspci -vvv
这里我截取网卡相关的片段
00:14.3 Network controller: Intel Corporation Device 06f0
Subsystem: Intel Corporation Device 0074
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 16
Region 0: Memory at c7714000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi, wl
lsmod
uname -sr
sudo lshw -class network
如果显示network is disabled
可以通过:sudo ifup wlo1
的方式去除disable,注意wlo1是我这里的名称
(如果想把正常的变成disable就可以:sudo ifdown wlo1
)
$ sudo ifup wlo1
ifup: interface wlo1 already configured
完全没有安装过网卡的,适合刚刚安装好ubuntu系统,而电脑的网卡不能显示的情况
出现:No Wi-Fi Adapter Found
Make sure you have a Wi-Fi adapter plugged and turn on
1.查看自己的网卡型号,这里是ubuntu的查看方式(其它的系统也可能是其它命令):
lspci
或
lspci -nnk | grep -i net
得到的结果中:Ethernet Controller 后是以太网卡型号,Network controller 后面的就是无线网卡型号
从windows查看(控制面板–网络和Internet–网络和共享中心 里的 以太网(或者wlan)–详细信息中):
明确几个问题:
0.网卡的驱动是不是装了(一般原本正常能用wifi,突然某天不能用了,驱动一般是好的!)
1.WiFi有没有被disable或者hardblock
rfkill list all
0: hci0: Bluetooth 这个是我电脑的蓝牙
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN 这个是我电脑内的网卡
Soft blocked: no
Hard blocked: no
2: phy1: Wireless LAN这个是插到电脑上的usb网卡
Soft blocked: no
Hard blocked: no
如果你的Soft blocked 或Hard blocked
出现了yes,那你就去查如何把ubuntu的wifi的硬件阻止或者软件阻止开启
2.如果尝试了很多次都没有解决(用了所有方法,都没有修复ubuntu的wifi)
如果在Software & Updates
里面(这里的Additional Drivers
里面可以让ubuntu自己找缺失的驱动),没法自动识别网卡
如果在Inter corporation:Unknown
处显示This device is not working
接下来你考虑:
换一下ubuntu的软件中的系统源(如果觉得自己sudo apt-get install *app,之类的下载安装东西觉得自己网速慢了,那就可以试试换一下源,有时候不一定是清华的源比阿里的好…):
1.备份
备份/etc/apt/sources.list
文件
mv /etc/apt/sources.list /etc/apt/sourses.list.backup
2.新建
新建/etc/apt/sources.list
文件并添加以下内容
sudo gedit /etc/apt/sources.list
2.1 ubuntu18.04阿里源:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
2.2 ubuntu18.04的其它源
#ubuntu18.04清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#ubuntu18.04中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
3 更新
更改完成之后执行以下命令
sudo apt update
sudo apt upgrade
我完成了这几步后,wifi出现了,但是不能使用,WiFi是一个空心WiFi的形状
在这个界面提示wifi unmanaged
可以像我这样:
sudo gedit /etc/NetworkManager/NetworkManager.conf
然后把里面内容替换为:
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=true
[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:gsm,except:type:cdma,except:type:wwan,except:type:ethernet,except:type:vlan
[device]
wifi.scan-rand-mac-address=no
然后重启一下网卡
sudo systemctl restart network-manager
我的WiFi就修好了
但是之后电脑总是提示"Activation of network connection failed Ubuntu"
试试:sudo apt update && sudo apt install --reinstall openvpn easy-rsa
网上也有说重启路由器、重启电脑能修好的