Install Realtek network driver on Ubuntu Note

Overview

When I built my own PC, Ubuntu was not recognizing the Realtek onboard wired LAN of Mazabo (ASUS). Therefore, leave the procedure until the wired LAN is opened. After installing Ubuntu, I think that it may not be possible to connect to the Internet by wire ...

--Implementation time: December 2020

Install build-essential (offline)

The compile environment (build-essential) must be installed on the target PC to install the driver. Normally, "sudo apt install build-essential" will solve the problem, but this is not possible because the target PC does not connect to the Internet. So

  1. Create a deb file list (URL) required for build-essential on the target PC
  2. Download all deb files from which list on another PC connected to the internet
  3. Copy the downloaded deb file to the target PC
  4. Install all deb files on the target PC at once It becomes the procedure

If you type the following on the target PC, the URL of the deb file required for that package will be output as a list. (The following'build-essential'is the package name for apt install)

sudo apt-get --print-uris install build-essential | cut -d\' -f2 | grep http:// > urls.txt

If you get the error "no installation candidate", select'Main server'for Downloads from Software & Updates. image.png By the way, the urls.txt output this time was as follows.

http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc-dev-bin_2.27-3ubuntu1.2_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-112.113_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc6-dev_2.27-3ubuntu1.2_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/libitm1_8.4.0-1ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/libatomic1_8.4.0-1ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/libasan4_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/liblsan0_8.4.0-1ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/libtsan0_8.4.0-1ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/libubsan0_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/libcilkrts5_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/libmpx2_8.4.0-1ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/libquadmath0_8.4.0-1ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/libgcc-7-dev_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/gcc-7_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-defaults/gcc_7.4.0-1ubuntu2.3_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/libstdc++-7-dev_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/g++-7_7.5.0-3ubuntu1~18.04_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-defaults/g++_7.4.0-1ubuntu2.3_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/m/make-dfsg/make_4.1-9.1ubuntu1_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg-dev_1.19.0.5ubuntu2.3_all.deb http://archive.ubuntu.com/ubuntu/pool/main/b/build-essential/build-essential_12.4ubuntu1_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/f/fakeroot/libfakeroot_1.22-2ubuntu1_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/f/fakeroot/fakeroot_1.22-2ubuntu1_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/liba/libalgorithm-diff-perl/libalgorithm-diff-perl_1.19.03-1_all.deb http://archive.ubuntu.com/ubuntu/pool/main/liba/libalgorithm-diff-xs-perl/libalgorithm-diff-xs-perl_0.04-5_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/liba/libalgorithm-merge-perl/libalgorithm-merge-perl_0.08-3_all.deb http://archive.ubuntu.com/ubuntu/pool/main/m/manpages/manpages-dev_4.15-1_all.deb

Copy this urls.txt file to a USB memory, take it to a PC connected to the net, and download all deb files with wget. Put the downloaded deb file in one folder (for example, deb folder) and copy it to the target PC (for example, Downloads folder). Go to that folder and use dpkg to extract and install the deb file

cd Downloads/deb
sudo dpkg -i *.deb

The second linux-libc-dev_4.15.0-112.113_amd64.deb from the top was downloaded from here using a browser because the link was broken and wget could not be done.

Check and there seem to be several ways to install the package offline, but I think this is probably the easiest if you are going offline temporarily like this time.

Note!!

There is a build-essential deb file in the live USB pool folder, but don't install it with dpkg! Since it depends on many other packages (above), there is no such thing. Without this, an error will occur, and as a result, apt itself will be broken (experience story).

Realtek Ethernet driver installation

Driver download

Confirm that the onboard LAN is Realtek R8125 with the lspcl command

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

On a PC connected to the Internet, download "2.5G Ethernet LINUX driver ..." at the top of the figure below from here, and copy it to any folder on Ubuntu using a USB memory etc. I went with a wireless LAN connected

image.png

In the terminal, go to that path and unzip it

tar -jxvf r8125-9.004.01.tar.bz2

Installation

There is a procedure in here, and it worked if I followed it. The procedure I took is as follows

1. Create dkms.conf file

Go to the path of the folder you unzipped above (such as Downloads/r8125-9.004.01) and create a new file with vim You can also use a text editor. Copy and paste the contents below However, PACKAGE_VERSION should be rewritten to that of the downloaded driver. It seems that this file does not require re-registration of the driver even if the kernel is updated in the future. To put it the other way around, if you don't have this file, you may not be able to use the onboard LAN before you know it.

PACKAGE_NAME="r8125"
PACKAGE_VERSION="9.004.01"
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="YES"
REMAKE_INITRD="YES"
CLEAN="rm src/@[email protected] src/*.o || true"

Name the file dkms.conf and save it in the current path After saving, I changed the authority just in case

sudo chmod 777 dkms.conf

2. Remove old drivers (if any)

If you already have an older version of the driver installed, do the following Of course, change the version number to that older version

sudo dkms remove r8125/9.002.02 --all
sudo rm -rf /usr/src/r81259.002.02/
sudo dkms status

3. Driver registration

Move this folder to/usr/src and register the driver with autorun.sh in the same folder. Again, change the version in the same way as above

cd
sudo cp -R Downloads/r8125-9.004.01/ /usr/src/r8125-9.004.01
cd /usr/src/r8125-9.004.01
sudo bash autorun.sh

After rebooting, I couldn't connect to the network again Do the following here

cd /usr/src/r8125-9.004.01
sudo bash autorun.sh      #This will connect you to the internet
sudo apt install dkms
sudo dkms add -m r8125 -v 9.004.01  #Register the driver with dkms

I thought that the last process was in autorun.sh, but it doesn't seem to be the case After the implementation, everything is going well

Other

Immediately after installation, Ubuntu 16 and 18 and 20 will recognize your USB wifi adapter and connect to the net, so this is unrelated work for such people

that's all

Recommended Posts

Install Realtek network driver on Ubuntu Note
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
Install Autoware on Ubuntu 18.04.5
Install Homebrew on Ubuntu 20.04
How to install network drivers on standalone Ubuntu
Load Suica on Ubuntu + Identiv Cloud 3701 F (preliminary note 3)
Load Suica on Ubuntu + Identiv Cloud 3701 F (preliminary note 2)
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
Install Realtek network driver on Ubuntu Note
How to install NVIDIA driver on Ubuntu 18.04 (Note)
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Install Docker on Ubuntu Server 20.04
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
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
Install JDK and JRE on Ubuntu 16.10
Install ngrok on ubuntu16.04 using Vagrant
Note Book: OpenBLAS Install On Windows10
How to install WildFly on Ubuntu 18.04
Install MQTT broker Mosquitto on Ubuntu 18.04
Install SonarQube on ECS instance on Ubuntu 16.04
Note Book: LAPACK Install On Windows 10
Note Book: VTK Install On Windows10
Install ruby on Ubuntu 20.04 with rbenv
Install imagick on macOS Catalina + php 7.4 Note
Headless install of Ubuntu 20.10 on Raspberry Pi
Install OpenJDK (Java) on the latest Ubuntu
How to install production Metabase on Ubuntu
I want to install PHP 7.2 on Ubuntu 20.04.
Wine settings on Ubuntu 18.04 (install WOLF RPG Editor)
Install Ubuntu Core 18 on Raspberry Pi 2 Model B
Note Book: OpenCV with CUDA Install On Windows10
How to install multiple JDKs on Ubuntu 18.04 LTS
Install and switch between multiple Javas on Ubuntu
Install the latest version of Jenkins on Ubuntu 16
tmux on Ubuntu
Load Suica on Ubuntu + Identiv Cloud 3701 F (preliminary note 3)
Install Autoware Autonomous Driving Simulator LG SVL on Ubuntu 18.04
Install rbenv with apt on ubuntu and put ruby
Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]
Load Suica on Ubuntu + Identiv Cloud 3701 F (preliminary note 2)
Screen recording on Ubuntu 20.04
Install gradle on mac
Install Corretto 8 on Windows
Install OpenJDK on macOS
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
Install Java on Mac
Install Golang on CentOS 8
Use Flutter on Ubuntu
Install Neo4j 4.1.3 on centOS
Install ROS Noetic ubuntu20.04
Note: Ubuntu installation location
Install Docker on Manjaro
Install Vertica 10.0 on CentOS 6.10