FreeBSD: ldconfig -v Lost Dynamic Linker Configuration

I‘ve typed ldconfig -v (Linux like command) under FreeBSD 7.1_P4_64 bit to get list of directories used by system. But I lost all my configuration and getting shared object not found errors for almost all commands such as vim or bash and so on. How do I fix this problem without rebooting the system?

FreeBSD’s ldconfig binary does not work the same as the Linux. When you entered ldconfig -v, you lost all your configuration information loaded from the hints file.

The ldconfig utility is used to prepare a set of hints for use by the dynamic linker to facilitate quick lookup of shared libraries available in multiple directories. It scans a set of built-in system directories. To fix the problem, type the following command:
# /etc/rc.d/ldconfig restart
# /etc/rc.d/ldconfig forcerestart
To list the current contents of the hints file on the screen, type:
# ldconfig -r
# ldconfig -r | less

Sample Output:

        search directories: /lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/compat/pkg:/usr/local/lib/mysql:/usr/local/lib/pth
        0:-lc.7 => /lib/
        1:-lcrypt.4 => /lib/
        237:-lpth.20 => /usr/local/lib/pth/
        238:-lpthread.20 => /usr/local/lib/pth/

/var/run/ is default FreeBSD hints file for the ELF dynamic linker stored at /libexec/ directory.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum