分页: 1 / 1

新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-02 19:16
suuare
按照网上的例子一步步安装驱动程序,结果在重启后驱动失效。我的操作过程如下:
下载官方驱动程序r8168-8.039.00.tar.bz2
检查版本:
-> lspci -v
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
Subsystem: ASRock Incorporation Device 8168
Kernel driver in use: r8169
Kernel modules: r8169

-> rmmod r8169
-> mv /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko ~/r8169.ko.backup
我的uname -r是3.XXX什么的 忘了...而且我这里压根就没有r8169.ko 这个文件... ...

解压后
-> cd r8168-8.009.00
-> make clean modules
-> make install

-> depmod -a
-> insmod ./src/r8168.ko 第一次安装时,到这里就可以上网了,那个高兴啊...

-> mv /initrd.img ~/initrd.img.backup
-> mkinitramfs -o /boot/initrd.img-`uname -r` `uname -r`

echo "r8168" >> /etc/modules
重启系统,再次
-> lspci -v
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
Subsystem: Gigabyte Technology Co., Ltd Motherboard
Flags: bus master, fast devsel, latency 0, IRQ 73
I/O ports at d000
Memory at fe100000 (64-bit, non-prefetchable)
Memory at dc100000 (64-bit, prefetchable)
Capabilities: <access denied>
Kernel driver in use: r8169
可以看出还是8169的驱动....
再次安装时
insmod ./src/r8168.ko
提示文件已存在...
不知咋弄,望兄弟们帮忙!

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-02 19:20
luojie-dune
需要装驱动么?需要装驱动的硬件直接丢了好了。

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-02 20:56
poloshiao
把下面指令 複製 貼進終端機 執行
1. sudo lshw -numeric -class network
2. sudo ifconfig -a
把結果直接複製 貼上來

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-03 1:44
236069750
上网非常卡啊。。。跟新源没办法

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-03 6:57
poloshiao
2014-10-03 01_18_47 _______________.png
終端機指令及回應文字
請直接複製來 不必擷圖
方便回文時引用

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-03 21:54
suuare
我以为大家都在过节呢,谢谢poloshiao老兄! 以下是终端机的内容:
suuare@QD-Home:~$ sudo lshw -numeric -class network
[sudo] password for suuare:
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10EC:8168]
vendor: Realtek Semiconductor Co., Ltd. [10EC]
physical id: 0
bus info: pci@0000:03:00.0
logical name: eth0
version: 06
serial: 74:d4:35:e3:d6:33
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:73 ioport:d000(size=256) memory:fe100000-fe100fff memory:dc100000-dc103fff
suuare@QD-Home:~$ sudo ifconfig -a
eth0 Link encap:以太网 硬件地址 74:d4:35:e3:d6:33
inet6 地址: fe80::76d4:35ff:fee3:d633/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:7 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:2 错误:0 丢弃:47 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:420 (420.0 B) 发送字节:168 (168.0 B)

lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:159 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:159 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:11265 (11.2 KB) 发送字节:11265 (11.2 KB)

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-03 21:56
suuare
对了,补充一下
用 lspci -v
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
Subsystem: Gigabyte Technology Co., Ltd Motherboard
Flags: bus master, fast devsel, latency 0, IRQ 73
I/O ports at d000
Memory at fe100000 (64-bit, non-prefetchable)
Memory at dc100000 (64-bit, prefetchable)
Capabilities: <access denied>
Kernel driver in use: r8169
这里Kernel driver in use: r8169 还是8169。麻烦你了!

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-04 11:33
poloshiao
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10EC:8168]
configuration: autonegotiation=on broadcast=yes driver=r8169
參閱
viewtopic.php?p=3106391#p3106391
先安裝合適的驅動

安裝好 再試試
1. sudo lshw -numeric -class network
2. sudo ifconfig -a
把結果直接複製 貼上來

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-05 0:28
suuare
poloshiao 您好!感谢你在假期对我的帮助!
我是在
http://218.210.127.131/downloads/downlo ... Down=false
下载的驱动程序,这个应该是官网了。Description:LINUX driver for kernel 3.x and 2.6.x and 2.4.x version:8.039 事实上一开始我就安装的这个驱动。但是在安装过程中遇到了问题:
root@QD-Home:/TL8168# bzip2 -d r8168-8.039.00.tar.bz2
root@QD-Home:/TL8168# ls
r8168-8.039.00.tar
root@QD-Home:/TL8168# tar -xf r8168-8.039.00.tar
root@QD-Home:/TL8168# cd r8168-8.039.00
root@QD-Home:/TL8168/r8168-8.039.00# ls
autorun.sh Makefile README src
root@QD-Home:/TL8168/r8168-8.039.00# make clean modules
make -C src/ clean
make[1]: 正在进入目录 `/TL8168/r8168-8.039.00/src'
make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/TL8168/r8168-8.039.00/src clean
make[2]: 正在进入目录 `/usr/src/linux-headers-3.13.0-32-generic'
make[2]:正在离开目录 `/usr/src/linux-headers-3.13.0-32-generic'
make[1]:正在离开目录 `/TL8168/r8168-8.039.00/src'
make -C src/ modules
make[1]: 正在进入目录 `/TL8168/r8168-8.039.00/src'
make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/TL8168/r8168-8.039.00/src modules
make[2]: 正在进入目录 `/usr/src/linux-headers-3.13.0-32-generic'
CC [M] /TL8168/r8168-8.039.00/src/r8168_n.o
CC [M] /TL8168/r8168-8.039.00/src/r8168_asf.o
CC [M] /TL8168/r8168-8.039.00/src/rtl_eeprom.o
CC [M] /TL8168/r8168-8.039.00/src/rtltool.o
LD [M] /TL8168/r8168-8.039.00/src/r8168.o
Building modules, stage 2.
MODPOST 1 modules
CC /TL8168/r8168-8.039.00/src/r8168.mod.o
LD [M] /TL8168/r8168-8.039.00/src/r8168.ko
make[2]:正在离开目录 `/usr/src/linux-headers-3.13.0-32-generic'
make[1]:正在离开目录 `/TL8168/r8168-8.039.00/src'
root@QD-Home:/TL8168/r8168-8.039.00# make install
make -C src/ install
make[1]: 正在进入目录 `/TL8168/r8168-8.039.00/src'
make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/TL8168/r8168-8.039.00/src INSTALL_MOD_DIR=kernel/drivers/net/ethernet/realtek modules_install
make[2]: 正在进入目录 `/usr/src/linux-headers-3.13.0-32-generic'
INSTALL /TL8168/r8168-8.039.00/src/r8168.ko
Can't read private key
DEPMOD 3.13.0-32-generic
make[2]:正在离开目录 `/usr/src/linux-headers-3.13.0-32-generic'
make[1]:正在离开目录 `/TL8168/r8168-8.039.00/src'
root@QD-Home:/TL8168/r8168-8.039.00# depmod -a
root@QD-Home:/TL8168/r8168-8.039.00# insmod ./src/r8168.ko
insmod: ERROR: could not insert module ./src/r8168.ko: File exists

提示文件已存在。这一步在我第一次安装的时候没有出现错误,而且第一次安装到这里的时候就能上网了。只是在重启以后又不行了,再次安装驱动就遇到这个问题。

root@QD-Home:/TL8168/r8168-8.039.00# lshw -numeric -class network
*-network UNCLAIMED
description: Ethernet controller
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10EC:8168]
vendor: Realtek Semiconductor Co., Ltd. [10EC]
physical id: 0
bus info: pci@0000:03:00.0
version: 06
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd cap_list
configuration: latency=0
resources: ioport:d000(size=256) memory:fe100000-fe100fff memory:dc100000-dc103fff

root@QD-Home:/TL8168/r8168-8.039.00# ifconfig -a
lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:112 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:112 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:8768 (8.7 KB) 发送字节:8768 (8.7 KB)
这里看好像跟以前一样的。谢谢!

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-05 1:34
suuare
补充:
我首先用rmmod r8168再rmmon 6189
再insmod ./src/r8168.ko就好了,能上网。现在我就再ubuntu下回复的帖子。可是如果重启系统就又不行了,只有重复上述过程才行。好像看起来并不是驱动没有装好,而是r8169没有卸载。
mv /lib/modules/3.13.0-32-generic/kernel/drivers/net/r8169.ko ~/r8169.ko.backup时里面根本就没有这个文件,请问poloshiao兄,这个该怎么解决?

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-05 7:25
poloshiao
root@QD-Home:/TL8168/r8168-8.039.00# ls
autorun.sh Makefile README src
1. 詳細閱讀 README 內容
cat ./README
configuration: autonegotiation=on broadcast=yes driver=r8169
好像看起来并不是驱动没有装好,而是r8169没有卸载。
2. 把 r8169 列入載入黑名單
http://www.linuxquestions.org/questions ... ost4996199
echo "blacklist r8169" >> /etc/modprobe.d/blacklist.conf
INSTALL /TL8168/r8168-8.039.00/src/r8168.ko
Can't read private key
insmod: ERROR: could not insert module ./src/r8168.ko: File exists
3. 先把 ./src/r8168.ko 更改檔案名稱
mv ./src/r8168.ko ./src/r8168.ko.backup
这一步在我第一次安装的时候没有出现错误
4. 因為安裝 Ubuntu 時 並沒有預裝 ./src/r8168.ko
再insmod ./src/r8168.ko就好了,能上网。现在我就再ubuntu下回复的帖子。可是如果重启系统就又不行了,
5. insmod ./src/r8168.ko 是一次性載入模組
要每次開機都載入 需要寫進 /etc/modules
r8168
5-1. 安裝以後的模組名稱是不是 r8168 請查 README 內容

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-05 15:23
suuare
按照README的内容:
If you are running the target kernel, then you should be able to do :
# ./autorun.sh (as root or with sudo)
我首先卸载r8169再卸载r8168之后./autorun.sh
结果就好了,现在重启也正常了。看开不仔细看说明是不对的。呵呵!感谢poloshiao兄!

但是问题虽然解决了,遗留了一些问题:
驱动程序的安装错综复杂,这次是厂家提供了一个简单方便的方式。如果不是这样,我想就比较麻烦了,poloshiao兄能否提供一些安装驱动方面的资料?以便小弟学习,再次感谢!

Re: 新手ubuntu14下安装RTL8168网卡驱动程序的问题

发表于 : 2014-10-05 17:36
poloshiao
驱动程序的安装错综复杂,这次是厂家提供了一个简单方便的方式。如果不是这样,我想就比较麻烦了,poloshiao兄能否提供一些安装驱动方面的资料?以便小弟学习,再次感谢!
1. 如果 硬件由廠家研發 驅動由廠家供應 一般廠家的研發人員會把安裝方法的文字檔案 打包在驅動套件中 通常使用 全是大寫英文字母作為檔案名稱
詳細閱讀這些全是大寫英文字母的文字檔案 可以幫助你找到最有效的安裝方法
2. Ubuntu 研發人員 會彙整許多同類的硬件裝置 撰寫在 Ubuntu 的安裝注意事項 作為上面安裝方法的補充 使用 ubuntu driver help wiki guide 關鍵字 搜尋
3. Ubuntu 基於 Debian
使用 debian driver help wiki guide 關鍵字 搜尋
4. 開源套件 是 Linux kernel 研發人員的目標
http://www.linuxdriverproject.org/media ... ers_Needed
http://www.linux-drivers.org/
http://www.freedesktop.org/wiki/Software/
http://wireless.kernel.org/en/users/Drivers
https://backports.wiki.kernel.org/index.php/Main_Page