Score:0

Forcefully adding a shared library to my lib folder on Ubuntu made my Linux system no longer able to execute shell commands

sh flag

While trying to debug a crash on an Ubuntu Linux system related to a missing library named libdthread.so.1, I added a so file with this name in the lib folder. I see now this was a bad idea, since now my machine is no longer usable. Now, any command I enter, for example ls, I get:

ls: symbol lookup error: /lib/libdthread.so.1: undefined symbol: __data_start

I cannot delete the problem file because rm or unlink command like "ls" command above does not work. Is there anything I can do to get out of this situation other than reinstall the system?

Martin avatar
kz flag
download a rescue disk, boot from the rescue disk, and remove the bad file
Score:1
cn flag

Boot a working instance, mount the broken file system, and repair. Such as booting rescue mode on reboot, or from install media. Or, move the disk to some other working instance, if a VM or otherwise shared storage.

Usually repair of system software could mean apt reinstall a package from the repo you were using. However a quick search of https://packages.ubuntu.com finds basically nothing about libdthread.so.1 in recent releases. Where did this come from, and how did ls get linked to it?

Or, if you have backups of the operating system, restore those.

Yes, reinstall the system is an option that always can get you to a sane system. While you have the disks mounted, back up data somewhere else. Then should a clean install be necessary, nothing will be lost.


Making sense of a program crash usually involves getting human readable symbols for the exact version of the libraries in use.

Program core dump logging and analysis programs vary between Linux distros, unfortunately. An Ubuntu wiki page give examples of installing debug symbols and a pointer to apport-retrace. Recent Ubuntu releases have debuginfod indexes, so a gdb session can download symbols from a remote service as needed.

Of course, if that code did not come from Ubuntu, you will need to source builds unstriped of symbols somewhere else.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.