尝试安装新的 wifi 驱动程序和 dkms 时,出现错误“无模块源目录”

尝试安装新的 wifi 驱动程序和 dkms 时,出现错误“无模块源目录”

我在使用 Ubuntu 14.04 时经常出现 Wi-Fi 断线的情况。我尝试使用以下代码修复此问题:

sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms git 
git clone https://github.com/pvaret/rtl8192cu-fixes.git
sudo dkms add ./rtl8192cu-fixes
sudo dkms install 8192cu/1.9
echo "blacklist rtl8192cu" | sudo tee -a /etc/modprobe.d/blacklist.conf

当我输入第四行时sudo dkms install 8192cu/1.9,出现了这个错误:

$ sudo dkms install 8192cu/1.9
Error! Could not find module source directory.
Directory: /usr/src/8192cu-1.9 does not exist.
$

我该如何解决这个问题?下一步该做什么?

以下是网卡信息:

$ lspci -nnk | grep -iA2 net; rfkill list all
01:00.0 Network controller [0280]: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter [168c:0036] (rev 01)
    Subsystem: Foxconn International, Inc. Device [105b:e068]
    Kernel driver in use: ath9k
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: acer-wireless: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
$

如果有帮助的话,以下是前三个命令的输出:

$ sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms git   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  dkms
0 upgraded, 1 newly installed, 4 reinstalled, 0 to remove and 0 not upgraded.
Need to get 3,401 kB of archives.
After this operation, 351 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main dkms all 2.2.0.3-1.1ubuntu5.14.04.5 [65.4 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.3 [2,586 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-3.19.0-56-generic amd64 3.19.0-56.62~14.04.1 [743 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-generic amd64 3.13.0.83.89 [2,232 B]
Fetched 3,401 kB in 10s (321 kB/s)                                             
(Reading database ... 703929 files and directories currently installed.)
Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ...
Unpacking build-essential (11.6ubuntu6) over (11.6ubuntu6) ...
Selecting previously unselected package dkms.
Preparing to unpack .../dkms_2.2.0.3-1.1ubuntu5.14.04.5_all.deb ...
Unpacking dkms (2.2.0.3-1.1ubuntu5.14.04.5) ...
Preparing to unpack .../git_1%3a1.9.1-1ubuntu0.3_amd64.deb ...
Unpacking git (1:1.9.1-1ubuntu0.3) over (1:1.9.1-1ubuntu0.3) ...
Preparing to unpack .../linux-headers-3.19.0-56-generic_3.19.0-56.62~14.04.1_amd64.deb ...
Unpacking linux-headers-3.19.0-56-generic (3.19.0-56.62~14.04.1) over (3.19.0-56.62~14.04.1) ...
Preparing to unpack .../linux-headers-generic_3.13.0.83.89_amd64.deb ...
Unpacking linux-headers-generic (3.13.0.83.89) over (3.13.0.83.89) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up build-essential (11.6ubuntu6) ...
Setting up dkms (2.2.0.3-1.1ubuntu5.14.04.5) ...
Setting up git (1:1.9.1-1ubuntu0.3) ...
Setting up linux-headers-3.19.0-56-generic (3.19.0-56.62~14.04.1) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.19.0-56-generic /boot/vmlinuz-3.19.0-56-generic
Setting up linux-headers-generic (3.13.0.83.89) ...

$ git clone https://github.com/pvaret/rtl8192cu-fixes.git
Cloning into 'rtl8192cu-fixes'...
remote: Counting objects: 435, done.
remote: Total 435 (delta 0), reused 0 (delta 0), pack-reused 435
Receiving objects: 100% (435/435), 1.80 MiB | 251.00 KiB/s, done.
Resolving deltas: 100% (222/222), done.
Checking connectivity... done.

$ sudo dkms add ./rtl8192cu-fixes

Creating symlink /var/lib/dkms/8192cu/1.10/source ->
                 /usr/src/8192cu-1.10

DKMS: add completed.
$

答案1

你已经拥有设备的驱动程序,ath9k。如果您遇到连接中断的情况,您可以尝试以下几种方法。

首先,检查路由器中的设置。首选 WPA2-AES;而不是任何 WPA 和 WPA2 混合模式,当然也不是 TKIP。其次,如果您的路由器支持 N 速度,那么使用 2.4 GHz 频段的 20 MHz 信道宽度(而不是自动 20/40 MHz)可能会获得更好的连接性,尽管它可能会影响 N 速度。使用固定信道(1、6 或 11)比自动信道选择更能带来更好的连接效果。此外,请确保路由器未设置为仅使用 N 速度;首选自动 B、G 和 N。进行这些更改后,重新启动路由器。

接下来,我建议明确设置你的监管范围。检查你的:

sudo iw reg get

如果您选择 00,则这是一个通用的设置。请在此处查找您的设置:http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2然后暂时设置一下:

sudo iw reg set IS

当然,如果不是冰岛,请替换您的国家代码。永久设置它:

gksudo gedit /etc/default/crda

如果您没有文本编辑器 gedit,请使用 nano 或 Kate 或 leafpad。

将最后一行改为:

REGDOMAIN=IS

仔细校对,保存并关闭文本编辑器。

接下来,我在网络管理器中将 IPv6 设置为忽略:http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/images/netconfig/network-connections-ipv6-ignore.png 此示例适用于以太网,但您想要无线。

如果这些更改没有帮助,请尝试:

sudo -i
echo "options ath9k nohwcrypt=1"  >  /etc/modprobe.d/ath9k.conf
exit

重启。

答案2

正确的第四行应该是:

sudo dkms install 8192cu/1.10

查看你的输出dkms 添加,您已创建一个名为

/usr/src/8192cu-1.10

相关内容