[LINUX] How to install network drivers on standalone Ubuntu

background

  1. I wanted to play a game called Among us, and I was playing around with the Proton settings on Ubuntu.
  2. I noticed that the GPU driver could not be installed.
  3. I tried to type the following appropriate command.
sudo ubuntu-drivers autoinstall

Network and sound are dead. Originally, I used USB-NIC because it was troublesome to install the driver for the Ethernet socket on the motherboard. I was able to recognize the USB-NIC normally, but I couldn't even use it with the above operation. Did you do something else? Well, let's recover for the time being. At this time, let's set it for the Ethernet socket of the motherboard.

Situation survey

I checked the current kernel version below.

$ uname -r
5.4.0-54-generic

Next, I investigated the types of network chips.

$ lspci | grep Ether
06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)

It's realtek RTL8125. I checked if the driver was in place. It is under the directory of the kernel Ver that has already been checked.

$ls /lib/modules/5.4.0-54-generic/kernel/drivers/net/ethernet/realtek/
8139cp.ko  8139too.ko

There is no RTL8125. I need to make this one. The files for RTL8125 driver generation can be obtained from the Realtek official page below. https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software

I was able to use the following. Screenshot from 2020-11-22 13-57-46.png

From the contents of Makefile and autorun.sh, I can see that the make and gcc commands are required to generate the driver, but unfortunately they are not installed. I can't use the net, so I can't apt install. So I will generate a driver on another sub PC and bring it with a USB drive.

environment

Main PC:

Details Remarks
OS Ubuntu 20.04
CPU AMD Ryzen 9 3900XT
network chip Realtek RTL8125

Sub PC:

Details Remarks
OS Ubuntu 18.04
CPU Intel(R) Core(TM) i5-8400

Sub PC work procedure

  1. Install Ubuntu20.04 on VirtualBox and check that the kernel version is the same as the main PC with uname -r. The first time was different, so after upgrading it became the same. Please refer to other articles. This or something

  2. Download the above official files on VirtualBox and execute ./autorun.sh in that folder. Probably there is a message that something is missing, but if the driver is generated in step 3, there is no problem.

  3. Execute the following on VirutualBox and confirm that r8125.ko exists.

$ ls /lib/modules/5.4.0-54-generic/kernel/drivers/net/ethernet/realtek/
8139cp.ko  8139too.ko  atp.ko  r8125.ko  r8169.ko
  1. Move r8125.ko from the Virutual Box to the sub PC. Please move this with scp or shared folder.

  2. Use the USB drive to move r8125.ko from the sub PC to the following folder on the main PC.

/lib/modules/5.4.0-54-generic/kernel/drivers/net/ethernet/realtek/

Main PC work procedure

  1. Temporarily apply as a driver with the following command.
 $ sudo insmod /lib/modules/5.4.0-54-generic/kernel/drivers/net/ethernet/realtek/r8125.ko
  1. After a few seconds, confirm that the network is back.

  2. After confirming, type the following command so that it will be enabled even after rebooting.

sudo depmod -a

that's all.

(Bonus) How to revive the sound.

Only Dummy Output was output in the setting audio Output Device. I tried the following command. inxi was installed with apt.

$ inxi -SMA
System:
  Host: ueda-System-Product-Name Kernel: 5.4.0-54-generic x86_64 bits: 64 
  Desktop: Gnome 3.36.4 Distro: Ubuntu 20.04.1 LTS (Focal Fossa) 
Machine:
  Type: Desktop Mobo: ASRock model: B550M Steel Legend 
  serial: <superuser/root required> BIOS: American Megatrends v: P1.10 
  date: 06/11/2020 
Audio:
  Device-1: NVIDIA GP107GL High Definition Audio driver: N/A
  Device-2: AMD Starship/Matisse HD Audio driver: N/A 
  Sound Server: ALSA v: k5.4.0-54-generic

Audio driver is N / A. This driver was installed by executing the following command.

sudo apt install linux-modules-extra-`uname -r`

Let's look again.

$ inxi -SMA
System:
  Host: ueda-System-Product-Name Kernel: 5.4.0-54-generic x86_64 bits: 64 
  Desktop: Gnome 3.36.4 Distro: Ubuntu 20.04.1 LTS (Focal Fossa) 
Machine:
  Type: Desktop Mobo: ASRock model: B550M Steel Legend 
  serial: <superuser/root required> BIOS: American Megatrends v: P1.10 
  date: 06/11/2020 
Audio:
  Device-1: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel 
  Device-2: AMD Starship/Matisse HD Audio driver: snd_hda_intel 
  Sound Server: ALSA v: k5.4.0-54-generic

The driver is now snd_hda_intel and the sound is coming out.

Afterword

I've been tied up with Ubuntu for about 7 years, and internet disconnections have often occurred. I have been taking crappy workarounds such as OS reinstallation every time, but I feel that I have improved as a Ubuntist by being able to take the above measures. This time, I generated the driver by cross-compiling with VirtualBox, but it may have been smartly generated by specifying the argument of make. I gave up the method because it didn't hit easily even when I checked it while working. Please let me know if you have any details.

make and gcc should be done immediately after OS installation. Then, it was just a matter of compiling on the main PC.

Recommended Posts

How to install network drivers on standalone Ubuntu
How to install WildFly on Ubuntu 18.04
How to install production Metabase on Ubuntu
How to install NVIDIA driver on Ubuntu 18.04 (Note)
How to install multiple JDKs on Ubuntu 18.04 LTS
How to install NVIDIA driver on Ubuntu ssh destination
How to install ImageMagick on Windows 10
How to use Bio-Formats on Ubuntu 20.04
How to install MariaDB 10.4 on CentOS 8
How to build vim on Ubuntu 20.04
How to Install Elixir and Phoenix Framework on Ubuntu 20.04 LTS
How to install java9 on elementaryOS Freya or Ubuntu 14.04 LTS
How to install Eclipse (Photon) on Mac
I want to install PHP 7.2 on Ubuntu 20.04.
How to install beta php8.0 on CentOS8
Install Realtek network driver on Ubuntu Note
How to change the timezone on Ubuntu
How to install kafkacat on Amazon Linux2
How to install and use Composer on an ECS instance on Ubuntu 16.04
How to install and configure the monitoring tool "Graphite" on Ubuntu
How to install Adopt OpenJDK on Debian, Ubuntu with apt (-get)
How to configure ubuntu to be used on GCP
How to install c2ffi on Ubuntu, which automatically parses C header files
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
How to install Docker
How to install docker-machine
Install Autoware on Ubuntu 18.04.5
How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?
How to install MySQL
Install Homebrew on Ubuntu 20.04
[Ruby on Rails] How to install Bootstrap in Rails
How to build a Pytorch environment on Ubuntu
How to run NullpoMino 7.5.0 on Ubuntu 20.04.1 64bit version
How to install ngrok
How to install Ruby on an EC2 instance on AWS
Install MySQL 5.6 on CentOS6 [How to specify the version]
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Install Docker on Ubuntu Server 20.04
[Rails] How to install devise
How to deploy on heroku
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
Install Arudino IDE on Ubuntu 20
Install Java on WSL Ubuntu 18.04
How to install Boots Faces
Install Ubuntu Desktop 20.10 on RaspberryPi4
Install Arduino IDE on Ubuntu 20.04
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Install PlantUML on Intellij on Ubuntu
Install Ubuntu Server 20.04 on Btrfs
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
[Rails] How to install simple_calendar
[Rails] How to install reCAPTCHA
How to install JDK8-10 (Mac)
How to add HDD to Ubuntu
How to run npm install on all projects in Lerna
How to Burning a Install Disk of Windows from Ubuntu
How to install JDK 8 on Windows without using the installer