How To Upgrade Mesa On Debian 11 With Minimal Risk

MX Linux maintains a repository consisting of an updated graphics stack and other components for Debian 11. This is the “AHS” (Advanced Hardware Support) repository and it's designed to provide support for newer hardware on older Debian-based releases. We're going to install just the Mesa portion of the updated graphics stack and use pinning to reduce the risk of breakage anything by holding back updates for all other packages in the repository.

Note: These instructions were vetted on LMDE5 and should work with some tweaking on other Debian 11 based releases. If you need assistance with a similar distribution or updates to these instructions contact support. These directions are intended for those looking to get Debian 11 graphics acceleration working through the installation of a limited set of upgraded components including the kernel from backports and Mesa from MX Linux's AHS repository.

1. Open a terminal and create a folder /etc/apt/keyrings if it doesn't exist and download the AHS repository key to it:

sudo mkdir /etc/apt/keyrings
cd /etc/apt/keyrings

sudo wget -O- |
gpg --dearmor |
sudo tee /etc/apt/keyrings/mx21repo.gpg > /dev/null

2. Open a terminal and create a list file for the "AHS" repository:

sudo nano /etc/apt/sources.list.d/mesa.list

3. Copy the following into the file and save it using crtl+x keys, hit the Y key to save (aka save modified buffer), and enter to confirm the file name you are saving:

deb [signed-by=/etc/apt/keyrings/mx21repo.gpg] bullseye main ahs

4. We're now going to create a preferences file to tell the system we don't want to automatically upgrade packages from this repository when we run apt upgrade:

sudo nano /etc/apt/preferences.d/mesa.pref

5. In the file we need to include the following:

Package: *
Pin: origin
Pin-Priority: 1

6. Save the file using crtl+x keys, hit the Y key to save (aka save modified buffer), and enter to confirm the file name you are saving.

7. We need now can run apt update to apply our new settings:

sudo apt update

8. Now install the Mesa software from the AHS repository:

sudo apt install -t mx {libglx-mesa0,libglapi-mesa,libegl-mesa0,libgl1-mesa-dri,mesa-va-drivers,mesa-vdpau-drivers,mesa-vulkan-drivers,libgbm1}

9. Install that latest kernel from backports:

sudo apt install -t bullseye-backports linux-image-amd64

10. Reboot the system and then open a terminal and verify that 3d acceleration is working:

vblank_mode=0 glxgears

Example of what the output will be on a 13th generation laptop with Intel graphics:

46594 frames in 5.0 seconds = 9318.658 FPS
45501 frames in 5.0 seconds = 9100.118 FPS

The near 10,000 FPS indicates that everything is working as it should be. If you saw 1,500 FPS here you'd know that 3D acceleration was not working. Debian will also present you with a graphical error message when you login about the system using frame buffer graphics.