本文主要是介绍Ubuntu安装网卡驱动,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
没有无线网
给自己装了双系统后,发现没有无线网络
下载驱动文件
打开终端,输入
lspci -k
能看到,虽然我是RTL8125BG,但use的是r8169:
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
DeviceName: Realtek RTL8125BG LAN
Subsystem: ASUSTeK Computer Inc. RTL8125 2.5GbE Controller
Kernel driver in use: r8169
Kernel modules: r8169
我们可以从官网下载驱动文件: https://www.realtek.com/Download/List?cate_id=584
根据我们的网卡,我下载2.5G那个。
编译安装
接下来我们安装编译环境
sudo apt update
sudo apt -f install
sudo apt install -y --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms
然后解压刚才下载的文件:
tsudo tar -xvf r8125-9.013.02.tar.bz2 -C /usr/src/
然后添加配置文件:
cd /usr/src/r8125-9.013.02
sudo nano ./dkms.conf
文件内容如下,对应的版本号即可:
PACKAGE_NAME=“r8125”
PACKAGE_VERSION=“9.013.02”
BUILT_MODULE_NAME[0]=“$PACKAGE_NAME”
DEST_MODULE_LOCATION[0]=“/updates/dkms”
AUTOINSTALL=“YES”
REMAKE_INITRD=“YES”
CLEAN=“rm src/@PKGNAME@.ko src/*.o || true”
然后编译:
sudo bash ./autorun.sh
出现 arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support ,安装一下binutils:
wget http://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz
tar -xzvf binutils-2.32.tar.gz
cd binutils-2.32
./configure
sudo make -j8
sudo make install
ld --version
as --version
然后针对这个报错:
At main.c:167:
- SSL error:02001002:system library:fopen:No such file or directory: …/crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: …/crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
Warning: modules_install: missing ‘System.map’ file. Skipping depmod.
DEPMOD 5.15.0-67-generic
解决办法输入如下:
cd /lib/modules/$(uname -r)/build/certs
sudo tee x509.genkey > /dev/null << ‘EOF’
[ req ]
default_bits = 4096
distinguished_name = req_distinguished_name
prompt = no
string_mask = utf8only
x509_extensions = myexts
[ req_distinguished_name ]
CN = Modules
[ myexts ]
basicConstraints=critical,CA:FALSE
keyUsage=digitalSignature
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
EOF
sudo openssl req -new -nodes -utf8 -sha512 -days 36500 -batch -x509 -config x509.genkey -outform DER -out signing_key.x509 -keyout signing_key.pem
重新编译
这篇关于Ubuntu安装网卡驱动的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!