Debian 11 (Bullseye) udev bug - No board or serial found

Background

In recent updates, Debian Bullseye (Debian 11) introduced a bug in udev that causes the command

ls /dev/serial/by-id/*

to fail, because the bug prevents the creation of this device path.
As of writing this, the bug remains unfixed in the regular Debian repositories, but it is already fixed in optional Debian repositories.

How to Diagnose

To check if the OS is affected by the bug, run:

sudo apt -y update && sudo apt -y upgrade
apt-cache policy udev

If the command’s output displays a version that contains deb11u2, then the impacted udev is installed. The output will resemble:

udev:
  Installed: 247.3-7+deb11u2
  Candidate: 247.3-7+deb11u2
  Version table:
 *** 247.3-7+deb11u2 500
        500 http://deb.debian.org/debian bullseye/main arm64 Packages
        100 /var/lib/dpkg/status

:grey_exclamation: Note:

  • Depending on the Debian flavor, some distributions have the bullseye-updates activated
  • This also cotains a fixed version meanwhile, so it is essential to update the system via apt to the latest state before checking for the buggy version

Automatic Solution

This shell script will automatically check if the affected udev version is installed and potentially remedy it.

Run this command:

curl -sf -L https://raw.githubusercontent.com/Sineos/useful_bits/main/Linux/fix_debian_udev.sh | sudo bash

:warning: WARNING:

  • This script requires root privileges and will error if not run as root
  • We have no intention of conducting any malicious activity on your installation. However, it is good practice to exercise caution when executing foreign scripts under root privileges.
  • If you do not feel comfortable with it, then follow the manual process below

In detail, above script will perform the following steps:

  1. Check for Debian 11 → If not, then exit
  2. Check for root rights → If not, then exit
  3. Update the system via apt update && apt upgrade
  4. Check for buggy deb11u2 version string → If not, then exit
  5. Check for an already installed backports repository → If not, then download / install the key and add the repository to apt
  6. Update udev to latest “bullseye-backports” version, that is listed here

The script will also create some kind of debug log file under /tmp/debug_fix_udev.log
If you experience any issues with this script, then start a new post and attach the above-mentioned log.

Manual Solution

To remedy the situation, you can use the following approach:

  1. Execute sudo apt edit-sources
  2. In the editor that opens (if asked, choose nano) add the following line at the end:
    deb http://ftp.debian.org/debian bullseye-backports main non-free contrib
    
  3. Save and close
  4. Run: sudo apt update
  5. Closely monitor the output of the above command. On errors, see below
  6. Run: sudo apt install udev -t bullseye-backports
  7. Reboot

Depending on the “flavor” of Debian Bullseye, e.g. Armbian, Pi OS , MainsailOS etc, it can happen that the public keys of the repository are not available in the keyring.

This results in an error message during apt update similar to:

W: GPG error: http://ftp.debian.org/debian bullseye-backports  InRelease: 
   The following signatures couldn't be verified because the public key is not 
   available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
E: The repository 'http://ftp.debian.org/debian bullseye-backports  InRelease' 
   is not signed.
N: Updating from such a repository can't be done securely, and is therefore 
   disabled by default.

This error message can be solved by executing:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9

After these commands, rerun the above steps 4. to 7.

:grey_exclamation: Note:

  • Using apt-key is considered deprecated and no longer recommended.
  • Unfortunately, the “correct” approach is considerably more complicated, and therefore not implemented in this context.
  • The automatic script version above will use the recommended approach
8 Likes