关于/lib/udev/rules.d/75-net-description.rules规则作用及删除可行性的技术咨询
Hey there! Let's break down exactly what this udev rule does and whether you can safely remove it for your personal Linux setup.
First, what does this rule do?
This is a system-provided udev rule (hence the note saying not to edit it—updates will overwrite any changes you make). Let's walk through its logic step by step:
ACTION=="remove", GOTO="net_end"&SUBSYSTEM!="net", GOTO="net_end": These are guard clauses. If the event is a device being removed, or the device isn't part of the network (net) subsystem, the rule stops immediately. Only valid network device events proceed.IMPORT{builtin}="net_id": Calls udev's built-innet_idtool to collect basic network device identifiers—things like MAC addresses, interface naming hints, and other attributes used to identify the network adapter.- For USB network adapters:
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb": If the network device is connected via USB, it pulls in USB-specific vendor/model info withusb_id, then fetches human-friendly device descriptions from the system's hardware database (hwdb). It then jumps to the end of the rule.
- For PCI network adapters (like your motherboard's built-in Ethernet port):
SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}": Sets environment variables to store the PCI device's vendor and model IDs.SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci": Fetches human-friendly descriptions for the PCI network device from the hardware database.
LABEL="net_end": Marks the end of the rule's execution.
In short: This rule's core job is to gather and set standardized, human-readable metadata for your network adapters. This info is used by system tools like NetworkManager or systemd-networkd to identify adapters, assign stable interface names (like enp0s3 instead of random eth0/eth1), and show friendly names in logs or network settings menus.
Should you delete it?
Since you're using Linux as a personal PC (not a server) and just need internet access, here's the bottom line:
- Do NOT delete this rule. It's a foundational part of how your system manages network devices, and removing it will cause unnecessary headaches:
- Your network interface names may become unstable (e.g., switching from
enp0s3toeth0on reboot), which can break saved network configurations (like static IPs) that are tied to specific interface names. - Network management tools (like NetworkManager) will only show raw hardware IDs instead of friendly names (e.g., "Intel Ethernet Controller" instead of a random string), making troubleshooting network issues way harder.
- Even if you delete it, the next system update will re-install the rule automatically (since it's part of your distro's udev/systemd package), so your effort will be wasted.
- Your network interface names may become unstable (e.g., switching from
This rule doesn't enable any "personal network" features you don't want—it just helps your system properly recognize and manage the network hardware you use to connect to the internet. There's no downside to leaving it in place.
备注:内容来源于stack exchange,提问作者pac_2023

