In recent updates, Debian Bullseye (Debian 11) introduced a bug in udev that causes the command
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.
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
- 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
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
- 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:
- Check for Debian 11 → If not, then exit
- Check for root rights → If not, then exit
- Update the system via
apt update && apt upgrade
- Check for buggy
deb11u2version string → If not, then exit
- Check for an already installed backports repository → If not, then download / install the key and add the repository to apt
- Update udev to latest “bullseye-backports” version, that is listed here
The script will also create some kind of debug log file under
If you experience any issues with this script, then start a new post and attach the above-mentioned log.
To remedy the situation, you can use the following approach:
sudo apt edit-sources
- 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
- Save and close
sudo apt update
- Closely monitor the output of the above command. On errors, see below
sudo apt install udev -t bullseye-backports
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.
apt-keyis 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