Ubuntu14 安裝r8168失敗,謝謝!(型號更正爲rtl8822be,已解決,方法21楼,非常感谢!!)

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Ubuntu14 安裝r8168失敗,謝謝!(型號更正爲rtl8822be,已解決,方法21楼,非常感谢!!)

#1

帖子 chegan » 2018-01-08 23:16

一 环境 Ubuntu:14 kernel:4.4.0-104-generic 硬件:r8168 雙系統win10正常使用
二 参考文档:http://blog.sina.com.cn/s/blog_4ea7460201018ll3.html
三 问题及现象:
按参考文档,裏面有兩個驅動,都試了下
1 使用支持到kernel 4.7 驅動,重啓已無效。ifconfig 搜不到waln
$ sudo ./autorun.sh

Check old driver and unload it.
rmmod r8168
Build the module and install
At main.c:222:
- SSL error:02001002:system library:fopen:No such file or directory: bss_file.c:169
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: bss_file.c:172
sign-file: certs/signing_key.pem: No such file or directory
DEPMOD 4.4.0-104-generic
load module r8168
Updating initramfs. Please wait.
update-initramfs: Generating /boot/initrd.img-4.4.0-104-generic
Completed.

2 使用支持到kernel 2.4 驅動,根據內置readme如以下3步,無效

(1)ezio@stealth:~/Downloads/r1000_v1.07$ sudo make clean modules
make -C src/ clean
make[1]: Entering directory `/home/ezio/Downloads/r1000_v1.07/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags
make[1]: Leaving directory `/home/ezio/Downloads/r1000_v1.07/src'
make -C src/ modules
make[1]: Entering directory `/home/ezio/Downloads/r1000_v1.07/src'
make -f Makefile_linux24x
gcc: error: /lib/modules/4.4.0-104-generic/build/include/linux/autoconf.h: No such file or directory
gcc: fatal error: no input files
compilation terminated.
make[2]: Entering directory `/home/ezio/Downloads/r1000_v1.07/src'
gcc -mcmodel=kernel -mno-red-zone -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall -I/lib/modules/4.4.0-104-generic/build/include -I. -DMODVERSIONS -DEXPORT_SYMTAB -include /lib/modules/4.4.0-104-generic/build/include/linux/modversions.h -c r1000_n.c -o r1000_n.o
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:59:1: fatal error: /lib/modules/4.4.0-104-generic/build/include/linux/modversions.h: No such file or directory
#endif
^
compilation terminated.
make[2]: *** [r1000_n.o] Error 1
make[2]: Leaving directory `/home/ezio/Downloads/r1000_v1.07/src'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/ezio/Downloads/r1000_v1.07/src'
make: *** [modules] Error 2


(2)ezio@stealth:~/Downloads/r1000_v1.07$ sudo make install
make -C src/ install
make[1]: Entering directory `/home/ezio/Downloads/r1000_v1.07/src'
install -m 644 -c r1000.o /lib/modules/4.4.0-104-generic/kernel/drivers/net/
install: cannot stat ‘r1000.o’: No such file or directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/ezio/Downloads/r1000_v1.07/src'
make: *** [install] Error 2

(3)sudo depmod -a
上次由 chegan 在 2018-01-16 20:22,总共编辑 4 次。
头像
vickycq
论坛版主
帖子: 4552
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
送出感谢: 100 次
接收感谢: 994 次
联系:

Re: Ubuntu14 安裝r8168失敗,謝謝!

#2

帖子 vickycq » 2018-01-08 23:35

鉴于你用的 HWE 内核,安装 16.04 的 r8168-dkms 试试。
https://packages.ubuntu.com/xenial/r8168-dkms

手动下载用 dpkg -i 安装
这些用户感谢了作者 vickycq 于这个帖子:
chegan (2018-01-09 1:57)
评价: 3.7%
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#3

帖子 chegan » 2018-01-09 1:56

vickycq 写了:鉴于你用的 HWE 内核,安装 16.04 的 r8168-dkms 试试。
https://packages.ubuntu.com/xenial/r8168-dkms

手动下载用 dpkg -i 安装
不好意思,请教下,我俩个驱动都试了下
1 [r8168_8.041.00-1.debian.tar.xz],解压后是debian目录,都是dkms后缀,没有deb后缀文件。我不知道怎么操作dkms文件


2 [r8168_8.041.00.orig.tar.bz2]安装报错,无法安装目标
头像
vickycq
论坛版主
帖子: 4552
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
送出感谢: 100 次
接收感谢: 994 次
联系:

Re: Ubuntu14 安裝r8168失敗,謝謝!

#4

帖子 vickycq » 2018-01-09 12:08

你下载的是源码包,不是二进制包。点击下面表格的 "all",然后点击一个镜像源地址,例如 http://kr.archive.ubuntu.com/ubuntu/poo ... -1_all.deb

安装之前先把之前手动编译安装的都清理干净

然后使用 dpkg -i r8168-dkms_8.041.00-1_all.deb 安装。如果由于安装失败等原因要移除,使用 dpkg -P r8168-dkms
这些用户感谢了作者 vickycq 于这个帖子:
chegan (2018-01-09 13:32)
评价: 3.7%
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#5

帖子 chegan » 2018-01-09 13:16

vickycq 写了:你下载的是源码包,不是二进制包。点击下面表格的 "all",然后点击一个镜像源地址,例如 http://kr.archive.ubuntu.com/ubuntu/poo ... -1_all.deb

安装之前先把之前手动编译安装的都清理干净

然后使用 dpkg -i r8168-dkms_8.041.00-1_all.deb 安装。如果由于安装失败等原因要移除,使用 dpkg -P r8168-dkms
额,谢谢,晚上我试试
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#6

帖子 chegan » 2018-01-09 22:27

vickycq 写了:你下载的是源码包,不是二进制包。点击下面表格的 "all",然后点击一个镜像源地址,例如 http://kr.archive.ubuntu.com/ubuntu/poo ... -1_all.deb

安装之前先把之前手动编译安装的都清理干净

然后使用 dpkg -i r8168-dkms_8.041.00-1_all.deb 安装。如果由于安装失败等原因要移除,使用 dpkg -P r8168-dkms
不好意思,還是失敗了,我用dpkg -P r8168-dkms清理過了,還是失敗,log如下


(Reading database ... 218577 files and directories currently installed.)
Preparing to unpack r8168-dkms_8.041.00-1_all.deb ...

-------- Uninstall Beginning --------
Module: r8168
Version: 8.041.00
Kernel: 4.4.0-104-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

r8168.ko:
- Uninstallation
- Deleting from: /lib/modules/4.4.0-104-generic/
rmdir: failed to remove ‘’: No such file or directory
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.

depmod....

Backing up initrd.img-4.4.0-104-generic to /boot/initrd.img-4.4.0-104-generic.old-dkms
Making new initrd.img-4.4.0-104-generic
(If next boot fails, revert to initrd.img-4.4.0-104-generic.old-dkms image)
update-initramfs....

DKMS: uninstall completed.

------------------------------
Deleting module version: 8.041.00
completely from the DKMS tree.
------------------------------
Done.
Unpacking r8168-dkms (8.041.00-1) over (8.041.00-1) ...
Setting up r8168-dkms (8.041.00-1) ...
Loading new r8168-8.041.00 DKMS files...
Building only for 4.4.0-104-generic
Building initial module for 4.4.0-104-generic
Done.

r8168:
Running module version sanity check.
Error! Module version 8.041.00-NAPI for r8168.ko
is not newer than what is already found in kernel 4.4.0-104-generic (8.045.08-NAPI).
You may override by specifying --force.

depmod....

Backing up initrd.img-4.4.0-104-generic to /boot/initrd.img-4.4.0-104-generic.old-dkms
Making new initrd.img-4.4.0-104-generic
(If next boot fails, revert to initrd.img-4.4.0-104-generic.old-dkms image)
update-initramfs....

DKMS: install completed.
Processing triggers for initramfs-tools (0.103ubuntu4.9) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-104-generic
Processing triggers for shim-signed (1.32~14.04.2+0.9+1474479173.6c180c6-1ubuntu1) ...
Secure Boot not enabled on this system.
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#7

帖子 chegan » 2018-01-10 12:01

是不是我的显卡型号写错了?win10 鲁大师查看,型号是瑞昱RTL 8168/8111/8112
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#8

帖子 chegan » 2018-01-10 13:47

vickycq 写了:你下载的是源码包,不是二进制包。点击下面表格的 "all",然后点击一个镜像源地址,例如 http://kr.archive.ubuntu.com/ubuntu/poo ... -1_all.deb

安装之前先把之前手动编译安装的都清理干净

然后使用 dpkg -i r8168-dkms_8.041.00-1_all.deb 安装。如果由于安装失败等原因要移除,使用 dpkg -P r8168-dkms
不好意思,我搞错了,之前全是安装的有线网卡,我是想装无线网卡,一直以为无线,有线网卡都集成到一了,无线网卡型号如下
RTL8822be 802.11ac pcie
我看网上资料挺多的,我先试试看
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#9

帖子 chegan » 2018-01-11 22:12

http://blog.csdn.net/xingce_cs/article/details/76851087
現在按照此文檔安裝,結果在make這步出錯,無法解決,求助了
ezio@stealth:~/rtlwifi-next$ make
make -C /lib/modules/4.4.0-104-generic/build M=/home/ezio/rtlwifi-next modules
make[1]: Entering directory `/usr/src/linux-headers-4.4.0-104-generic'
CC [M] /home/ezio/rtlwifi-next/base.o
In file included from /home/ezio/rtlwifi-next/base.c:26:0:
/home/ezio/rtlwifi-next/wifi.h:1434:40: error: ‘NUM_NL80211_BANDS’ undeclared here (not in a function)
struct ieee80211_supported_band bands[NUM_NL80211_BANDS];
^
/home/ezio/rtlwifi-next/base.c: In function ‘rtlwifi_rate_mapping’:
/home/ezio/rtlwifi-next/base.c:1056:25: warning: comparison between ‘enum nl80211_band’ and ‘enum ieee80211_band’ [-Wenum-compare]
if (NL80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
^
make[2]: *** [/home/ezio/rtlwifi-next/base.o] Error 1
make[1]: *** [_module_/home/ezio/rtlwifi-next] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-104-generic'
make: *** [all] Error 2
funicorn
帖子: 1131
注册时间: 2005-09-13 4:56
系统: Ubuntu QQ
送出感谢: 0
接收感谢: 47 次

Re: Ubuntu14 安裝r8168失敗,謝謝!

#10

帖子 funicorn » 2018-01-12 7:40

代码: 全选

wget -c http://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.170_all.deb
sudo dpkg -i /path/to/linux-firmware_1.170_all.deb
重启,行就行,不行就用windows吧。
chegan 写了:http://blog.csdn.net/xingce_cs/article/details/76851087
現在按照此文檔安裝,結果在make這步出錯,無法解決,求助了
ezio@stealth:~/rtlwifi-next$ make
make -C /lib/modules/4.4.0-104-generic/build M=/home/ezio/rtlwifi-next modules
make[1]: Entering directory `/usr/src/linux-headers-4.4.0-104-generic'
CC [M] /home/ezio/rtlwifi-next/base.o
In file included from /home/ezio/rtlwifi-next/base.c:26:0:
/home/ezio/rtlwifi-next/wifi.h:1434:40: error: ‘NUM_NL80211_BANDS’ undeclared here (not in a function)
struct ieee80211_supported_band bands[NUM_NL80211_BANDS];
^
/home/ezio/rtlwifi-next/base.c: In function ‘rtlwifi_rate_mapping’:
/home/ezio/rtlwifi-next/base.c:1056:25: warning: comparison between ‘enum nl80211_band’ and ‘enum ieee80211_band’ [-Wenum-compare]
if (NL80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
^
make[2]: *** [/home/ezio/rtlwifi-next/base.o] Error 1
make[1]: *** [_module_/home/ezio/rtlwifi-next] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-104-generic'
make: *** [all] Error 2
这些用户感谢了作者 funicorn 于这个帖子:
chegan (2018-01-12 10:11)
评价: 3.7%
添加ppa后只更新此ppa:
update-ppa()
{ sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
}
写入~/.bashrc,source一下,就可以直接用,是不是很方便?觉得方便就按个赞。
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#11

帖子 chegan » 2018-01-12 12:03

funicorn 写了:

代码: 全选

wget -c http://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.170_all.deb
sudo dpkg -i /path/to/linux-firmware_1.170_all.deb
重启,行就行,不行就用windows吧。
chegan 写了:http://blog.csdn.net/xingce_cs/article/details/76851087
現在按照此文檔安裝,結果在make這步出錯,無法解決,求助了
ezio@stealth:~/rtlwifi-next$ make
make -C /lib/modules/4.4.0-104-generic/build M=/home/ezio/rtlwifi-next modules
make[1]: Entering directory `/usr/src/linux-headers-4.4.0-104-generic'
CC [M] /home/ezio/rtlwifi-next/base.o
In file included from /home/ezio/rtlwifi-next/base.c:26:0:
/home/ezio/rtlwifi-next/wifi.h:1434:40: error: ‘NUM_NL80211_BANDS’ undeclared here (not in a function)
struct ieee80211_supported_band bands[NUM_NL80211_BANDS];
^
/home/ezio/rtlwifi-next/base.c: In function ‘rtlwifi_rate_mapping’:
/home/ezio/rtlwifi-next/base.c:1056:25: warning: comparison between ‘enum nl80211_band’ and ‘enum ieee80211_band’ [-Wenum-compare]
if (NL80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
^
make[2]: *** [/home/ezio/rtlwifi-next/base.o] Error 1
make[1]: *** [_module_/home/ezio/rtlwifi-next] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-104-generic'
make: *** [all] Error 2
安装出问题了。。。。。
ezio@stealth:~/rtlwifi-next$ sudo dpkg -i linux-firmware_1.170_all.deb
dpkg-deb: error: archive 'linux-firmware_1.170_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive linux-firmware_1.170_all.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
linux-firmware_1.170_all.deb
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#12

帖子 chegan » 2018-01-12 12:18

funicorn 写了:

代码: 全选

wget -c http://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.170_all.deb
sudo dpkg -i /path/to/linux-firmware_1.170_all.deb
重启,行就行,不行就用windows吧。
chegan 写了:http://blog.csdn.net/xingce_cs/article/details/76851087
現在按照此文檔安裝,結果在make這步出錯,無法解決,求助了
ezio@stealth:~/rtlwifi-next$ make
make -C /lib/modules/4.4.0-104-generic/build M=/home/ezio/rtlwifi-next modules
make[1]: Entering directory `/usr/src/linux-headers-4.4.0-104-generic'
CC [M] /home/ezio/rtlwifi-next/base.o
In file included from /home/ezio/rtlwifi-next/base.c:26:0:
/home/ezio/rtlwifi-next/wifi.h:1434:40: error: ‘NUM_NL80211_BANDS’ undeclared here (not in a function)
struct ieee80211_supported_band bands[NUM_NL80211_BANDS];
^
/home/ezio/rtlwifi-next/base.c: In function ‘rtlwifi_rate_mapping’:
/home/ezio/rtlwifi-next/base.c:1056:25: warning: comparison between ‘enum nl80211_band’ and ‘enum ieee80211_band’ [-Wenum-compare]
if (NL80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
^
make[2]: *** [/home/ezio/rtlwifi-next/base.o] Error 1
make[1]: *** [_module_/home/ezio/rtlwifi-next] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-104-generic'
make: *** [all] Error 2
能幫我搜下嗎? sudo grep -r "NUM_NL80211_BANDS" /usr/src/linux-headers* ,我改代碼試試看
chegan
帖子: 25
注册时间: 2017-12-24 22:24
系统: win7
送出感谢: 4 次
接收感谢: 0

Re: Ubuntu14 安裝r8168失敗,謝謝!

#13

帖子 chegan » 2018-01-12 13:11

我看4.14 内核是支持RTL8822 的,我现在是4.4
我只升级内核会有什么影响?现在要用到交叉编译之类工具,主要是android源代码工程相关
poloshiao
论坛版主
帖子: 17996
注册时间: 2009-08-04 16:33
送出感谢: 21 次
接收感谢: 1914 次

Re: Ubuntu14 安裝r8168失敗,謝謝!(型號更正爲rtl8822be,尚未解決)

#14

帖子 poloshiao » 2018-01-12 16:02

RTL8822be 802.11ac pcie
http://www.realtek.com/products/product ... ProdID=380
RTL8822BE

https://askubuntu.com/questions/635625/ ... rd-to-work
How do I get a Realtek RTL8723BE wireless card to work?
funicorn
帖子: 1131
注册时间: 2005-09-13 4:56
系统: Ubuntu QQ
送出感谢: 0
接收感谢: 47 次

Re: Ubuntu14 安裝r8168失敗,謝謝!

#15

帖子 funicorn » 2018-01-12 16:18

chegan 写了:我看4.14 内核是支持RTL8822 的,我现在是4.4
我只升级内核会有什么影响?现在要用到交叉编译之类工具,主要是android源代码工程相关
你没有安装linux-image-extra,所以系统里没有一些额外的驱动。为啥要用4.4?
添加ppa后只更新此ppa:
update-ppa()
{ sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
}
写入~/.bashrc,source一下,就可以直接用,是不是很方便?觉得方便就按个赞。
回复

回到 “网卡问题以及网络和拨号”