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天終于能夠在最合適的版本使用環境。