Ubuntu18.04 LTS +RTL 8125 出现安装完系统后没有网络问题
- 问题描述
- 最终解决方案
- 1.下载对应的Realtek网卡驱动,使用命令lspci查看网卡信息
- 安装网卡
- 3.重启电脑
- 记录过程
- 1.内核升级方式
- 1)下载新的内核驱动
- 2)安装内核驱动
- 3)重启电脑
- 4)出现问题
问题描述
由于主板以及设备使用的是较新的设备,使用的ubuntu18.04默认内核版本的网卡驱动不支持较新的网卡,导致出现没有网络问题。
最终解决方案
1.下载对应的Realtek网卡驱动,使用命令lspci查看网卡信息
lspci
'''
00:00.0 Host bridge: Intel Corporation Device a703 (rev 01)
00:01.0 PCI bridge: Intel Corporation Device a70d (rev 01)
00:06.0 PCI bridge: Intel Corporation Device a74d (rev 01)
00:0a.0 Signal processing controller: Intel Corporation Device a77d (rev 01)
00:0e.0 RAID bus controller: Intel Corporation Device a77f
00:14.0 USB controller: Intel Corporation Device 7a60 (rev 11)
00:14.2 RAM memory: Intel Corporation Device 7a27 (rev 11)
00:15.0 Serial bus controller [0c80]: Intel Corporation Device 7a4c (rev 11)
00:16.0 Communication controller: Intel Corporation Device 7a68 (rev 11)
00:17.0 SATA controller: Intel Corporation Device 7a62 (rev 11)
00:1a.0 PCI bridge: Intel Corporation Device 7a48 (rev 11)
00:1c.0 PCI bridge: Intel Corporation Device 7a38 (rev 11)
00:1c.7 PCI bridge: Intel Corporation Device 7a3f (rev 11)
00:1d.0 PCI bridge: Intel Corporation Device 7a36 (rev 11)
00:1f.0 ISA bridge: Intel Corporation Device 7a06 (rev 11)
00:1f.3 Audio device: Intel Corporation Device 7a50 (rev 11)
00:1f.4 SMBus: Intel Corporation Device 7a23 (rev 11)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device 7a24 (rev 11)
01:00.0 VGA compatible controller: NVIDIA Corporation Device 2487 (rev a1)
01:00.1 Audio device: NVIDIA Corporation Device 228b (rev a1)
02:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. Device 5017 (rev 03)
03:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. Device 5017 (rev 03)
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Device 8125 (rev 05)
'''
我的网卡对应的是r8125型号,对应的网卡下载地址是:R8125驱动下载链接
安装网卡
1.将网卡驱动下载后通过u盘或者其他方式拷贝到本机
2.解压网卡驱动包,进入驱动包,使用终端运行以下命令
sudo chmod +x autorun.sh
sudo ./autorun.sh
3.重启电脑
完成
记录过程
1.内核升级方式
一开始参考bilibili视频,步骤如下
1)下载新的内核驱动
根据弹幕推荐的最稳定的版本5.15,在ubuntu kernel网址(链接)下载了5.15.189的最新内核驱动
2)安装内核驱动
sudo dpkg -i ./*.deb
安装过程中报错
下列软件包有未满足的依赖关系:linux-headers-5.15.70-051570-generic : 依赖: libc6 (>= 2.34) 但是 2.27-3ubuntu1.6 已经安装依赖: libssl3 (>= 3.0.0~~alpha1) 但无法安装它
3)重启电脑
右上角出现了网络,网络已经能使用了
4)出现问题
后面在使用过程中因为需要用到显卡,nvidia-smi查看了显卡信息,发现报错:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.
Make sure that the latest NVIDIA driver is installed and running.
下载安装显卡驱动后报错:
ERROR: Unable to find the development tool cc in your path; please make sure that you have the package 'gcc' installed. If gcc is installed on your system, then please check that cc is in your PATH.
于是安装gcc报错
下列软件包有未满足的依赖关系:gcc-7 : 依赖: cpp-7 (= 7.3.0-16ubuntu3) 但是 7.5.0-3ubuntu1~18.04 正要被安装依赖: gcc-7-base (= 7.3.0-16ubuntu3) 但是 7.5.0-3ubuntu1~18.04 正要被安装依赖: libgcc-7-dev (= 7.3.0-16ubuntu3) 但是它将不会被安装libc6-dev : 依赖: libc6 (= 2.27-3ubuntu1) 但是 2.27-3ubuntu1.4 正要被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
后来才知道高版本内核 gcc对应的版本较高,显卡使用的内核头文件linux-headers又没有成功安装,导致显卡驱动异常。
查阅了网络相关信息,参考这个链接里发现ubuntu18.04最适合的内核驱动版本应该是5.4.x版本的
于是降级了内核版本
sudo apt-get -y install \
linux-image-5.4.0-150-generic \
linux-headers-5.4.0-150-generic \
linux-modules-5.4.0-150-generic
#列出内核版本信息
dpkg --list | grep linux-imagesudo apt-get purge linux-image-5.15*
sudo update-grub
降级后nvidia-smi正常了,但是网络又不见了,又开始循环,升级内核解决网络,查阅5.4版本网卡问题,最终看到了最适合我的文章链接,也就是本文章的解决方案。
具体历程有点绕,历时2天终于能够在最合适的版本使用环境。