本文主要是介绍Ubuntu有线没法上网(modprobe: ERROR: could not insert 'r8168':Required key not available),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- ubuntu有线无法上网,使用ifconfig没看到有线网卡,证明没有驱动
sudo lshw -C network显示:
*-network UNCLAIMED description: Ethernet controllerproduct:RTL8111/8168/8411 PCI Express Gigabit Ethernet Controllervendor: Realtek Semiconductor Co., Ltd.
*-network UNCLAIMED 即表示没有驱动。
-
去Realtek官网http://www.realtek.com/search/default.aspx?keyword=RTL8111 拉到下面,找到下载链接,找到linux对应的版本。
GBE Ethernet LINUX driver r8168 for kernel up to 4.15 8.048.00 2020/01/08 107 KB
解压并运行:sudo bash autorun.sh
注意:这里可能会报两个error,如果没有跳过第三步。
出现此问题的原因是,Ubuntu Kernel 使用 EFI_SECURE_BOOT_SIG_ENFORCE 内核配置,这样会阻止内核载入第三方模块。
Check old driver and unload it.
Build the module and install
At main.c:222:
- SSL error:02001002:systemlibrary:fopen:No such file or directory: bss_file.c:175
- SSL error:2006D080:BIO routines:BIO_new_file:no suchfile: bss_file.c:178
sign-file: certs/signing_key.pem: No such file ordirectory
DEPMOD 4.4.0-31-generic
load module r8168
modprobe: ERROR: could not insert 'r8168':Required key not available
Updating initramfs. Please wait.
update-initramfs: Generating/boot/initrd.img-4.4.0-31-generic
Completed.
解决方法如下:
- 在终端执行如下指令:
sudo apt install mokutil
sudo mokutil --disable-validation
执行后,终端会让你设置8-16位密码(之后要用,不要忘记哦~)
接下来,重启电脑,会出现蓝屏(不要紧张,按下任意键进入选择界面 :-)),选项如下:
- Continue boot
- Change Secure Boot state
- Enroll key from disk
- Enroll hash from disk
选择Change Secure Boot state,接下来会让你输入之前的密码。
我的系统很调皮,没有让我直接输入密码,而是要求 Enter password character 7,意思是输入密码的第7位(这点要注意!)。
接下来进入Disable Secure Boot选择界面,选择 yes(不要直接按下Enter,这样就前功尽弃,只能从头再来了!)。
然后下个界面又回到最开始的界面,选择reboot,重新进入系统,
重新安装:sudo bash autorun.sh
- 完成之后,检查是否安装成功
lsmod|grep r8168
[matt@localhost r8168-8.042.00]$ lsmod|grep r8168
r8168 491520 0 - 查看网卡状态
sudo lshw -C network
显示: *-network DISABLEDdescription: Ethernet interfaceproduct: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controllervendor: Realtek Semiconductor Co., Ltd.physical id: 0bus info: pci@0000:09:00.0logical name: enp9s0
- 启动网卡:(注意 logical name)
sudo ifconfig enp9s0 up
自动获得Ip:
sudo dhclient enp9s0
后续自动启动有线网卡的,本人还未用折腾,先用着吧。
其中主要折腾在于一直安装不上网卡。
目前开机直接输入步骤6就行了。
这篇关于Ubuntu有线没法上网(modprobe: ERROR: could not insert 'r8168':Required key not available)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!