Mediatek wi fi 6 mt7921 linux

How to install driver for Wi-Fi Mediatek MT7921 and Mediatek MT7961 in Linux

This post will show you how to fix the problem with Mediatek MT7921 and Mediatek MT7961 Wi-Fi adapters not working, which you can find in the latest laptop models, such as ASUS ROG G15 and Asus TUF Gaming A15 FX506L-HN004.

We need the mt76 driver, which provides the following chipsets (source):

  • MT7610U 802.11a/b/g/n/ac 1T1R 2.4/5GHz USB Chip
  • MT7612/MT7662 802.11a/b/g/n/ac 2T2R 2.4/5GHz PCIe/USB Chip
  • MT7630E 802.11a/b/g/n 1T1R 2.4/5GHz PCIe Chip
  • MT7610E 802.11a/b/g/n/ac 1T1R 2.4/5GHz PCIe Chip
  • MT7603E 802.11b/g/n 2T2R 2.4GHz PCIe chip and MT7628 802.11b/g/n 2T2R 2.4GHz SoC Device (4.7+)
  • MT7615 802.11a/b/g/n/ac 4T4R 2.4/5GHz PCIe Chip (5.2+)
  • MT7622 802.11b/g/n 4T4R 2.4GHz SoC Device (5.7+)
  • MT7663 802.11a/b/g/n/ac 2T2R 2.4/5GHz PCIe/USB/SDIO Chip (5.8+)
  • MT7915 802.11a/b/g/n/ac/ax 4T4R 2.4/5GHz PCIe Chip (5.9+)
  • MT7921 802.11a/b/g/n/ac/ax 2T2R 2.4/5GHz PCIe Chip (5.12+)

MT7961 is not included in this list, but the kernel module for MT7921 is responsible for its operation.

You can see the numbers in brackets – they indicate the version of the kernel from which the driver is supported. Yes, the good news is that the driver is supported by the Linux kernel out of the box, so, in theory, the user doesn’t need to take any action – the Wi-Fi adapter should “just work”.

But the problem is that the Linux kernel from version 5.12 is relatively fresh and not as widespread in Linux distributions. For example, a preliminary version of the 5.15 kernel is already available at the time of writing, and the 5.14 kernel is already used in Arch Linux. But Ubuntu 21.04 uses the 5.11 kernel, so Linux Mint has an even older kernel.

There are 2 ways out of this situation:

  1. Wait until your distribution receives the latest kernel version (it may never happen, since only new versions of distributions will receive a new kernel)
  2. Install the latest kernel version yourself (there are some risks for the system)

So, you need to install kernel 5.12 or later – how to do this depends on your particular distribution. This tutorial will show you how to install the latest kernel in:

  • Ubuntu and distributions that are based on Ubuntu
  • Linux Mint
  • Debian (stable and testing)
  • Kali Linux

I have kernel 5.12 or later, but Mediatek MT7921 (Mediatek MT7961) not working or working with problems

If you already have a fresh kernel 5.12 or newer installed, but Wi-Fi adapters or Bluetooth are working with problems, then this section is for you.

Читайте также:  Linux wine com порт

The Mediatek MT7921 and Mediatek MT7961 chipsets require firmware, which, although available in the standard distribution repositories, is usually not installed by default.

On Ubuntu, Linux Mint and derivatives, run the following command:

sudo apt install linux-firmware

On Debian derivatives, run:

sudo apt install firmware-misc-nonfree

In Kali Linux, run the following command:

sudo apt install kali-linux-firmware

On Arch Linux, Manjaro, BlackArch and their derivatives, run the command:

sudo pacman -S linux-firmware

Kernel update warning

All subsequent sections show you how to update your kernel to the latest version. It should be remembered that due to the incompatibility of the kernel with programs (first of all, with proprietary drivers), you may encounter problems, including a black screen during boot.

In most cases, the problems encountered can be resolved without reinstalling the distribution. Start by going to the advanced options in the boot menu and boot with the previous version of the kernel. After completing the boot, remove the problematic kernel.

Proprietary graphics card drivers can cause problems, as older versions may not be compatible with the latest kernels without a patch. If you have proprietary video drivers installed, then seriously consider before following the instructions below. Also get ready, look for instructions on how to solve the problem when loading the distribution into a black screen.

Owners of old distributions should be especially careful – it is strongly recommended to update the kernel only on the latest OS versions.

This instruction has been tested on distributions:

Ubuntu and Linux Mint installed kernel 5.14, and Kali Linux installed kernel 5.13. All distributions booted and worked fine.

Another very likely problem that you may encounter if you install the latest kernel is the problem with unresolved dependencies and, as a result, the inability to use the apt package manager to update and install programs. If you are faced with a situation where, after successfully installing a new kernel, you cannot update packages using apt, then try installing the previous versions of the kernel that suit you, and uninstall the versions that cause dependency problems. Remember that it is impossible to remove the kernel you booted with – boot your computer with any other version of the kernel before uninstalling.

Wi-Fi Mediatek MT7921 and Mediatek MT7961 not working in Ubuntu and Linux Mint (SOLVED)

For Ubuntu, there is a repository of compiled kernels of all versions, including the most recent, so installation is not particularly difficult — you do not need to compile the Linux kernel. Moreover, there are tools, including those with a graphical interface, to install any kernels.

Since Linux Mint is based on Ubuntu, this guide is fully applicable to Linux Mint distributions, except for LMDE. For LMDE (Linux Mint Debian Edition) see the following section on Debian and derivatives, respectively.

If you prefer a graphical interface then use Mainline:

sudo apt-add-repository -y ppa:cappelikan/ppa sudo apt update sudo apt install mainline mainline-gtk

In this tutorial, I will show you how to install the latest kernel on Ubuntu 21.04 using the ubuntu-mainline-kernel.sh command line utility.

Читайте также:  Боковая панель linux mint

Checking the current kernel version:

The kernel is version 5.11, and we need at least 5.12.

Download and install the ubuntu-mainline-kernel.sh script:

wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh sudo install ubuntu-mainline-kernel.sh /usr/local/bin/

We check which version of the kernel is the latest:

To display a list of available kernels versions for installation, run the command:

sudo ubuntu-mainline-kernel.sh -r

For example, we want to install the kernel version v5.12.11, then the command is as follows (you do not need to specify the “v” prefix):

sudo ubuntu-mainline-kernel.sh -i 5.12.11

Attention: tests have shown that to solve the problem with the Mediatek MT7921 (Mediatek MT7961) drivers, it is recommended to install the kernel version 5.12.11, since the 5.14 kernel, although it installs normally, subsequently brings problems with unresolved dependencies when using the apt package manager.

If you want to install the latest version at the moment, then run the following command:

sudo ubuntu-mainline-kernel.sh -i

You will be asked if you want to continue, type “y”:

Latest version is: v5.14.6, continue? (y/N)

The program has exited – a restart is required for the changes to take effect.

Check the kernel version again:

By default, your system will boot with the latest kernel, if you want to change this, then go to advanced boot options

and select the version you want from the installed kernels.

Don’t forget to install the firmware files:

sudo apt install linux-firmware

The same instruction was tested on Linux Mint 20.2.

As you can see, the kernel has been updated successfully and Linux Mint is running.

Wi-Fi Mediatek MT7921 and Mediatek MT7961 not working in Debian, Kali Linux (SOLVED)

This section should be suitable for all variations and derivatives of Debian, for example:

Let’s check the current kernel version:

In order not to compile the kernel from scratch, we will use the kernels of the XanMod Kernel project.

To install the latest kernel version, just run the following commands:

echo 'deb http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list wget -qO - https://dl.xanmod.org/gpg.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/xanmod-kernel.gpg add - sudo apt update && sudo apt install linux-xanmod

Wait for the update to complete and reboot.

Let’s check the kernel version again:

inux HackWare-Kali 5.13.19-xanmod1 #0~git20210919.7960459 SMP PREEMPT Sun Sep 19 13:46:36 UTC 2021 x86_64 GNU/Linux

If for some reason the GRUB menu has not been updated, then run the command:

Don’t forget to install the firmware files:

sudo apt install firmware-misc-nonfree

How to recover Linux after installing the kernel

If your computer boots with a black screen, freezes, or something doesn’t work after updating the kernel, reboot and select Advanced options for your distribution from the GRUB menu:

Then select the previous kernel version and press Enter:

Regardless of the reason, you need to boot with the previous version of the kernel if you want to remove the latest kernel. This is because you cannot remove the kernel that is currently in use.

If you do not see the GRUB2 menu, press and hold the Shift key or press the Esc key repeatedly (this may vary depending on BIOS or UEFI boot and the version of Ubuntu/Linux Mint you are using) while booting GRUB. The Grub menu should appear allowing you to select a previous kernel version.

Читайте также:  Port forwarding with ssh linux

After booting the previous kernel, you can remove the faulty kernel. ubuntu-mainline-kernel.sh allows you to remove kernels installed from the Ubuntu kernel PPA.

With ubuntu-mainline-kernel.sh you can remove the kernel version by running:

sudo ubuntu-mainline-kernel.sh -u VERSION

Where VERSION is the kernel version, for example 5.14. You can also use this utility with -u without specifying a version, in which case the tool will list up to 10 kernel versions and ask you which one you want to remove. It’s worth noting that ubuntu-mainline-kernel.sh will not show official Ubuntu kernels in this list.

To remove the XanMod kernel in Debian and derivatives run the commands:

sudo apt remove linux-xanmod sudo apt remove `sudo apt show linux-xanmod | grep Depends | sed 's/,//' | awk ''`

If this was not done automatically, then update your GRUB settings:

Источник

Ubuntu 20.04 does not have MediaTek driver MT7921 for WIFI & Bluetooth?

I bought a new laptop «Acer Aspire 5 A515-56-555H» with default OS — Windows 10 which running fine with all devices. I manage to install Ubuntu 20.04 in separate disk partition, but WiFi and bluetooth do NOT work. I notice Ubuntu 20.04 does not have Media Tek MT7921 driver for WIiFi and bluetooth. How can I download & install the drivers? Is there anyone who can help me?

askubuntu.com/questions/1333793/… and medium.com/@pjbgf/… indicates support with kernel 5.12+ (needs to be manually installed — there are always caveats when using non-standard kernels)

Thanks for the idea. I’m not good on compiling kernel and manual install Linux 5.12 may encounter other issues :).

My Asus Vivobook M7400Q had the MT7921 before I decided to replace it. On Ubuntu 20.04 / kernel 5.13 the WIFI adapter was either not found or it was found and would be very slow. Upgrading the kernel to 5.15.x and Ubuntu to 21.10 resolved some issues, but not all. The WIFI adapter would be detected in most cases, but not all. Bluetooth would not recognize my mouse anymore after sleep and wake up, forcing me to pair it again about 10 times per day. My advise: just buy an Intel AX200 for 20 eur with this laptop and install it. This adapter has zero WIFI or Bluetooth issues with Ubuntu 20.04

5 Answers 5

You must upgrade the Linux kernel to 5.14, and the rest of Ubuntu to 21.04.

How to upgrade from Kernel 5.11 to 5.14 click here

How to upgrade from Ubuntu 20.04 to 21.04 click here

I was having the same issue on TUF A17. It has MT7961 chipset. I was able to fix it with updating to latest kernel release (5.15-rc6):

wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15-rc6/amd64/linux-headers-5.15.0-051500rc6-generic_5.15.0-051500rc6.202110180730_amd64.deb wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15-rc6/amd64/linux-headers-5.15.0-051500rc6_5.15.0-051500rc6.202110180730_all.deb wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15-rc6/amd64/linux-image-unsigned-5.15.0-051500rc6-generic_5.15.0-051500rc6.202110180730_amd64.deb wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.15-rc6/amd64/linux-modules-5.15.0-051500rc6-generic_5.15.0-051500rc6.202110180730_amd64.deb sudo dpkg -i *.deb sudo reboot now 

Источник

Оцените статью
Adblock
detector