symlinks breaks lsb_release, but diff reports no changes?

Jeffrey Walton noloader at gmail.com
Mon Dec 15 17:21:20 UTC 2025


Hi Everyone,

I'm seeing an issue on Ubuntu 22.04.5 LTS that I can't explain.
Below, symlinks breaks lsb_release, but a diff of before/after reports
no changes.  Any help would be appreciated.

First, lsb_release works:

$ lsb_release -a
LSB Version:    core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

Second, run symlinks script (as root):

#!/usr/bin/env bash

symlinks -r / 1>symlinks.1.txt

for dir in /bin /etc /home /lib /lib32 /lib64 /media /mnt /opt /root
/run /sbin /srv /tmp /usr /var;
do
    # Ensure the directory exists
    test -d "${dir}" || continue
    # Skip directories that are tmpfs
    df -hT "${dir}" | grep -q tmpfs && continue
    # echo "  dir: ${dir}"
    symlinks -r -d "${dir}" 1>/dev/null
done

symlinks -r / 1>symlinks.2.txt

Third, try lsb_release again:

$ lsb_release -a
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 25, in <module>
    import lsb_release
ModuleNotFoundError: No module named 'lsb_release'

Fourth, diff the changes from symlinks:

$ diff symlinks.1.txt symlinks.2.txt
$

Fifth, reinstall lsb-release package:

$ sudo apt install --reinstall lsb-release

Sixth, recheck lsb_release:

$ lsb_release -a
LSB Version:    core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

One clue is from dpkg, but I don't know if it is a red herring:

$ dpkg -L lsb-release
...
/usr/share/pyshared
/usr/share/pyshared/lsb_release.py
/usr/lib/python2.7/dist-packages/lsb_release.py
/usr/lib/python3/dist-packages/lsb_release.py

And:

$ ls /usr/share/pyshared
lsb_release.py
$ ls /usr/share/pyshared/lsb_release.py
/usr/share/pyshared/lsb_release.py
$ ls /usr/lib/python2.7/dist-packages/lsb_release.py
ls: cannot access '/usr/lib/python2.7/dist-packages/lsb_release.py':
No such file or directory
$ ls /usr/lib/python3/dist-packages/lsb_release.py
ls: cannot access '/usr/lib/python3/dist-packages/lsb_release.py': No
such file or directory

$ ls -d /usr/lib/python*
/usr/lib/python2.7  /usr/lib/python3  /usr/lib/python3.10  /usr/lib/python3.11

And:

$ sudo find /usr/lib -name lsb_release.py
$

I am missing something.  Does anyone know what is going on?

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clean-symlinks.sh.zip
Type: application/zip
Size: 571 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20251215/5abf7e93/attachment.zip>


More information about the ubuntu-users mailing list