• Ubuntu 22.04 安装水星无线 USB 网卡


    我的 USB 网卡是水星 Mercury 的, 在 Ubuntu 22.04 下面没有自动识别。
    没有无线网卡的时候只能用有线接到路由器上,非常不方便。 寻思着把无线网卡驱动装好。折腾了几个小时装好了驱动。

    1.检查网卡类型 & 安装驱动

    使用 lsusb 看到的不一定是准确的网卡类型。
    用 dmesg 来看,运行 dmesg 命令,然后拔掉 usb 网卡,再插上,这个时候看屏幕上面的输出

    sudo dmesg
    # 拔掉 USB 网卡,重新插入,看终端屏幕的输出,我的是 rtl8821cu 的网卡。
    
    # 我的机器用 dmesg 观察日志的输入输出,usb 网卡重新插拔,观察到的网卡是 rtl8821cu,
    # 所以安装 rtl8821cu 的驱动
    sudo apt update 
    sudo apt install build-essential git dkms 
    git clone https://github.com/brektrou/rtl8821CU.git 
    cd rtl8821CU 
    
    chmod +x dkms-install.sh 
    # 如果这个命令运行失败,则运行 make, make install 两个命令也可以安装驱动
    sudo ./dkms-install.sh  
    # make
    # make install
    
    # 把模块添加到内核中,这个命令非常重要,命令没有输出表示成功
    sudo modprobe 8821cu
    
    # 然后运行 iwconfig 查看无线网卡,应该能看到网卡
    iwconfig
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    这是安装驱动之后 dmesg 命令看到的输出:
    dmesg 看到的输出

    2.iwconfig 可以看到网卡后, 连接到网络

    apt update
    apt install network-manager

    然后参考:
    https://askubuntu.com/questions/461825/how-to-connect-to-wifi-from-the-command-line

    • To see list of saved connections, use ()

      nmcli c
      
      • 1
    • To see list of available WiFi hotspots ()

      nmcli d wifi list
      
      • 1

      or:

      sudo iwlist  scanning
      
      • 1
    • To see list of interfaces ()

      ifconfig -a
      
      • 1

    前面的 WifiInterface, WiFiSSID 在配置网络的时候要用到。

    命令行下配置无线网络:

    nmtui
    
    • 1

    3.Troubleshooting:

    https://forums.linuxmint.com/viewtopic.php?t=324111

    https://help.ubuntu.com/stable/ubuntu-help/net-wireless-troubleshooting-hardware-check.html.en#usb

    https://forums.linuxmint.com/viewtopic.php?t=322917

  • 相关阅读:
    SQL Server 常见问题
    【如何看待Unity收费】对标中小公司的待就业者的该如何做
    realvnc-server-aarch64-ubuntu
    使用Jmeter进行性能测试的操作方法
    (附源码)ssm教培管理系统 毕业设计 230932
    制药企业设备管理常见问题和措施
    【畅购商城】详情页详情之商品详情
    day4_redis中分布式锁实现一人一单
    详解API基础知识
    UI5:面向企业级应用的JavaScript框架
  • 原文地址:https://blog.csdn.net/davidullua/article/details/134341282