Ok, I made a mistake and I'm struggling to fix it:

I was looking for a libGL.so to link a project, and found it in a (conan-related) package that is mounted during build time. The default system /usr/lib64/libGL.so.1 didn't seem to get picked up (different versions/dependencies?)

So I turned to ld.so.config to add the folder containing libGL.so, just under the only other line:

include /etc/ld.so.config.d/*
/hfs/xyz/conan-package-123/../usr/lib64/   # the line I added

then I ran

sudo ldconfig

and then was greeted by a slew of errors of the form

"ldconfig: /hfs/xyz/conan-package-123/../usr/lib64/libGL.so is not a symbolic link"

linking still does not work, but worse, I seem to have lost sudo privileges, and can no longer either run sudo ldconfig, su ldconfig or edit/write /etc/ld.so.config. I also tried using local versions from my home-dir for both the config and cache files using the ldconfig flags -f and -C, I don't seem to get my privileges back.

For the record, my /etc/passwd file is -rw-r--r-- root root and /etc is drwxr-xr-x root root, and pwck says

wck: Permission denied.
pwck: cannot lock /etc/passwd; try again later.

Should I restart some service for that? Otherwise that would be a true catch 22. What can I do?

1 Answer 1


After my VNC timed out, the problem became worse because the VNC connection would give up on connecting. I was locked out!

Clearly, the whole authentication process was suddenly borked. My reasoning was that sulogin-shell was picking up linked code with libc versions from the ld.so.cache that would conflict with other versions already loaded. It would complain about sulogin version conflicts and fail to load encryption cgp modules, at the very early stages of the boot process.

The only option was to go on-site to the physical machine and try to see what was going on. After a bit of digging, I found how to hack into my RHEL8 system.

  • reboot and press shift to enter GRUB
  • select the boot profile and press 'e' to edit (other rescue options did not work)
  • add init=/bin/bash at the end of the line that loads the kernel, this gives you a root prompt
  • apparently you can also put rw in front of that (I later learned)
  • press 'ctrl-x' to boot with that change
  • this puts you into some sort of fake root mode with a prompt
  • mount /proc
  • mount -o rw,remount / remounts the entries in /etc/fstab as read/write
  • now you can change files and folders again! I (re)moved the bad /etc/ld.so.cache and rewrote the /etc/ld.so.conf file without the offending path included. I then went looking for /usr/sbin/ldconfig and rebuilt the cache.
  • sync to make sure all changes are written to disk
  • umount
  • a cold reboot, and voila, the login prompt reappeared as normal.

After that also sudo worked as normal again.

Yay for me, my Linux karma just went up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .