Ubuntu 18.04 安装网卡驱动(有线连接)

news/2024/11/16 5:41:33/

之前一直用小米的驱动,但是感觉太慢了,所以还是决定使用有线连接。

但是之前进入Linux系统后,有线连接没有,所以需要安装驱动。

01 查询网卡类型(Windows)

进入windows系统,进入CMD命令行,输入systeminfo
查询网卡类型

在这里插入图片描述

网卡:             安装了 2 个 NIC。                                                                                                       
[01]: Realtek PCIe 2.5GbE Family Controller                                                                                 
连接名:      以太网 2                                                                                                   
启用 DHCP:   是                                                                                                         
DHCP 服务器: 10.193.0.1                                                                                                 
IP 地址                                                                                                                   
[01]: 10.193.194.9                                                                                                      
[02]: fe80::9b6:1e28:e575:69cd                                                                                          
[03]: 2001:da8:1002:8040::2:939c                                                                                  
[02]: Xiaomi 802.11n USB Wireless Adapter                                                                                   
连接名:      WLAN 2                                                                                                     
状态:        媒体连接已中断 

02 查询网卡驱动(Ubuntu)

在 Ubuntu打开终端,输入lspci -v 查看网卡驱动

如果末尾显示:Kernel driver in use:r8169

说明驱动版本不符,需要重新安装驱动,要安装RTL8125

选择安装RTL8125,是根据windows查询到的网卡类型选择的

查询结果如下:

guyue@guyue:~$ lspci -v
00:00.0 Host bridge: Intel Corporation Device 9b53 (rev 03)Subsystem: ASUSTeK Computer Inc. Device 8694Flags: bus master, fast devsel, latency 0Capabilities: <access denied>00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 03) (prog-if 00 [Normal decode])Flags: bus master, fast devsel, latency 0, IRQ 120Bus: primary=00, secondary=01, subordinate=01, sec-latency=0I/O behind bridge: 00004000-00004fffMemory behind bridge: 91000000-920fffffPrefetchable memory behind bridge: 00000000a0000000-00000000b1ffffffCapabilities: <access denied>Kernel driver in use: pcieport00:14.0 USB controller: Intel Corporation Device a3af (prog-if 30 [XHCI])Subsystem: ASUSTeK Computer Inc. Device 8694Flags: bus master, medium devsel, latency 0, IRQ 125Memory at 4000010000 (64-bit, non-prefetchable) [size=64K]Capabilities: <access denied>Kernel driver in use: xhci_hcd00:16.0 Communication controller: Intel Corporation Device a3baSubsystem: ASUSTeK Computer Inc. Device 8694Flags: bus master, fast devsel, latency 0, IRQ 136Memory at 4000025000 (64-bit, non-prefetchable) [size=4K]Capabilities: <access denied>Kernel driver in use: mei_meKernel modules: mei_me00:17.0 SATA controller: Intel Corporation Device a382 (prog-if 01 [AHCI 1.0])Subsystem: ASUSTeK Computer Inc. Device 8694Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 126Memory at 92304000 (32-bit, non-prefetchable) [size=8K]Memory at 92307000 (32-bit, non-prefetchable) [size=256]I/O ports at 5050 [size=8]I/O ports at 5040 [size=4]I/O ports at 5020 [size=32]Memory at 92306000 (32-bit, non-prefetchable) [size=2K]Capabilities: <access denied>Kernel driver in use: ahciKernel modules: ahci00:1b.0 PCI bridge: Intel Corporation Device a3e9 (rev f0) (prog-if 00 [Normal decode])Flags: bus master, fast devsel, latency 0, IRQ 121Bus: primary=00, secondary=02, subordinate=02, sec-latency=0I/O behind bridge: 00006000-00006fffMemory behind bridge: 90000000-901fffffPrefetchable memory behind bridge: 0000004000100000-00000040002fffffCapabilities: <access denied>Kernel driver in use: pcieport00:1c.0 PCI bridge: Intel Corporation Device a392 (rev f0) (prog-if 00 [Normal decode])Flags: bus master, fast devsel, latency 0, IRQ 122Bus: primary=00, secondary=03, subordinate=03, sec-latency=0I/O behind bridge: 00007000-00007fffMemory behind bridge: 90200000-903fffffPrefetchable memory behind bridge: 0000004000300000-00000040004fffffCapabilities: <access denied>Kernel driver in use: pcieport00:1c.3 PCI bridge: Intel Corporation Device a393 (rev f0) (prog-if 00 [Normal decode])Flags: bus master, fast devsel, latency 0, IRQ 123Bus: primary=00, secondary=04, subordinate=04, sec-latency=0I/O behind bridge: 00003000-00003fffMemory behind bridge: 92200000-922fffffCapabilities: <access denied>Kernel driver in use: pcieport00:1d.0 PCI bridge: Intel Corporation Device a398 (rev f0) (prog-if 00 [Normal decode])Flags: bus master, fast devsel, latency 0, IRQ 124Bus: primary=00, secondary=05, subordinate=05, sec-latency=0Memory behind bridge: 92100000-921fffffCapabilities: <access denied>Kernel driver in use: pcieport00:1f.0 ISA bridge: Intel Corporation Device a3c8Subsystem: ASUSTeK Computer Inc. Device 8694Flags: bus master, medium devsel, latency 000:1f.2 Memory controller: Intel Corporation Device a3a1Subsystem: ASUSTeK Computer Inc. Device 8694Flags: fast devselMemory at 92300000 (32-bit, non-prefetchable) [disabled] [size=16K]00:1f.3 Audio device: Intel Corporation Device a3f0Subsystem: ASUSTeK Computer Inc. Device 8797Flags: bus master, fast devsel, latency 32, IRQ 137Memory at 4000020000 (64-bit, non-prefetchable) [size=16K]Memory at 4000000000 (64-bit, non-prefetchable) [size=64K]Capabilities: <access denied>Kernel driver in use: snd_hda_intelKernel modules: snd_hda_intel, snd_sof_pci00:1f.4 SMBus: Intel Corporation Device a3a3Subsystem: ASUSTeK Computer Inc. Device 8694Flags: medium devsel, IRQ 11Memory at 4000024000 (64-bit, non-prefetchable) [size=256]I/O ports at efa0 [size=32]01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f0a (rev a1) (prog-if 00 [VGA controller])Subsystem: ASUSTeK Computer Inc. Device 879bFlags: bus master, fast devsel, latency 0, IRQ 142Memory at 91000000 (32-bit, non-prefetchable) [size=16M]Memory at a0000000 (64-bit, prefetchable) [size=256M]Memory at b0000000 (64-bit, prefetchable) [size=32M]I/O ports at 4000 [size=128]Expansion ROM at 000c0000 [disabled] [size=128K]Capabilities: <access denied>Kernel driver in use: nouveauKernel modules: nvidiafb, nouveau01:00.1 Audio device: NVIDIA Corporation Device 10f9 (rev a1)Subsystem: ASUSTeK Computer Inc. Device 879bFlags: bus master, fast devsel, latency 0, IRQ 17Memory at 92080000 (32-bit, non-prefetchable) [size=16K]Capabilities: <access denied>Kernel driver in use: snd_hda_intelKernel modules: snd_hda_intel04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Device 8125 (rev 04)Subsystem: ASUSTeK Computer Inc. Device 87d7Flags: fast devsel, IRQ 19I/O ports at 3000 [size=256]Memory at 92200000 (64-bit, non-prefetchable) [size=64K]Memory at 92210000 (64-bit, non-prefetchable) [size=16K]Capabilities: <access denied>Kernel modules: r816905:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. Device 500e (rev 01) (prog-if 02 [NVM Express])Subsystem: Kingston Technology Company, Inc. Device 500eFlags: bus master, fast devsel, latency 0, IRQ 16, NUMA node 0Memory at 92100000 (64-bit, non-prefetchable) [size=16K]Capabilities: <access denied>Kernel driver in use: nvmeKernel modules: nvme

在这里插入图片描述

03 Ubuntu下安装驱动

进入官网

  • https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software

选择Linux下的 r8125 进行安装
在这里插入图片描述

下载下来的文件名为:r8125-9.007.01.tar.bz2

将此文件右键解压缩,然后把压缩文件复制到想要安装的位置

然后进入此目录下,运行以下指令

cd ~/software/r8125-9.007.01
sudo chmod +x autorun.sh
sudo ./autorun.sh

运行结果如下:

guyue@guyue:~/software/r8125-9.007.01$ sudo chmod +x autorun.sh
[sudo] guyue 的密码: 
guyue@guyue:~/software/r8125-9.007.01$ sudo ./autorun.shCheck old driver and unload it.
rmmod r8169
Build the module and install
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:72
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:79
sign-file: certs/signing_key.pem: No such file or directory
Warning: modules_install: missing 'System.map' file. Skipping depmod.
Backup r8169.ko
rename r8169.ko to r8169.bak
DEPMOD 5.4.0-90-generic
load module r8125
Updating initramfs. Please wait.
update-initramfs: Generating /boot/initrd.img-5.4.0-90-generic
Completed.

安装完后运行以下指令,更新软件

sudo apt-get update
sudo apt-get install ubuntu-make

04 后续问题解决

电脑重启以后,网络有线连接又没有了,然后重新运行下述代码,网络有限连接就又有了

cd ~/software/r8125-9.007.01
sudo chmod +x autorun.sh
sudo ./autorun.sh

05 参考

  • https://blog.csdn.net/weixin_43077628/article/details/114497451
  • https://blog.csdn.net/qq_38365929/article/details/119799973

http://www.ppmy.cn/news/734969.html

相关文章

linux装完显卡驱动分辨率低,装上显卡驱动后屏幕分辨率变低了,肿么破。。。...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) Subsystem: Device 1b0a:2099 Kernel driver in use: agpgart-intel 00:01.0 PCI bridge: Intel Corporation Xeon E3-1…

Python 之测试数据驱动

Parameterized 模块 parameterized 第三方包的安装&#xff1a; pip install parameterized $ pip install parameterized Collecting parameterizedDownloading https://files.pythonhosted.org/packages/65/d4/b0b626eb263a4c2aa3ca3cd20ea3db410db837f7f6b5d3fc4a6c4bee363…

华为服务器linux版的网卡驱动下载,华为服务器RH2288H V3 服务器上安装Windows2008 R2 SP1指导书...

1 安装前准备 1.1 硬件环境准备 无 备注: 本指导书以虚拟光驱、虚拟软驱为例,如使用物理光驱、物理软驱安装系统操作则以实际系统光盘、软盘代替。 1.2 软件环境准备 1.2.1 准备操作系统安装文件 到windows 官网下载安装文件,或者采用光盘安装文件。 …

Clover 驱动文件夹_Intel全系利核显驱动教程

关注上方蓝字关注黑果小白 让小白为你排忧解难 1 驱动准备 清理旧驱动 显卡驱动准备工作,请清理以前的驱动→获取 IGPU 的设备路径→填入 ig-platform-id→填入 device-id关于HD4600集显驱动,举个例子:驱动完 HD4600 也就这点东西。仿冒设备id及核显型号就可以了!缩写解释缩…

shumei gpio

2019独角兽企业重金招聘Python工程师标准>>> • 树莓派GPIO介绍 树莓派包含8个通用IO (GPIO) 用于开关控制 (switch control)&#xff0c;配合扩展版可以进行继电器、电机、LED等外设的驱动。该扩展IO的位置如下所示&#xff1a; Figure 1. 树莓派1扩展IO在板上的位…

Ubuntu搭建驱动开发环境

1、使用的是linux-5.0.1 ubuntu1910 2、安装依赖 build-essential kernel-package gcc make libncurses5-dev libssl-dev libelf-dev均可用sudo apt-get install … 3、源文件获取与安装 3.1、获取内核源码 # 查看系统内核版本 uname -r 5.0.0-32-generic # 获取源文件包 …

WinXP内核驱动调试

友链 使用vmware创建一个xp虚拟机&#xff0c;确保你是Administrator用户&#xff0c;打开cmd&#xff0c;cd进入C盘根目录 然后执行notepad boot.ini&#xff0c;内容应该是下面这样的 [boot loader] timeout30 defaultmulti(0)disk(0)rdisk(0)partition(1)\WINDOWS [opera…

linux内核编译指定驱动,linux内核编译,配置本机驱动

1.前言 编译linux内核失败的原因很多时候就是驱动选错&#xff0c;适合自己本机的驱动没编译进去。面对特殊平台(或者有些洁癖者&#xff0c;我就是^_^)&#xff0c;要编译精简内核&#xff0c;只要本机驱动&#xff0c;其他都不需要。面对内核里面这么多驱动&#xff0c;不懂硬…