Linux Mint

How to Install and Use libtree on Linux Mint 21

The libtree is a command-line tool that displays the dependencies of a shared library or executable in a tree-like format, where each level of the tree represents a different level of dependency. It can be useful for understanding the dependencies of a program and troubleshooting issues related to missing or incompatible libraries, this guide is all about installing it on Linux Mint 21

Installing libtree on Linux Mint 21

Installing libtree on Linux is a straightforward process that can be completed in a few simple steps. Before you begin, make sure that your Linux Mint system is up-to-date and that you have administrative privileges. Since the correct way to get this tool on Linux Mint 21 is by downloading its executable file from GitHub and for that execute:

$ sudo wget -qO /usr/local/bin/libtree https://github.com/haampie/libtree/releases/latest/download/libtree_x86_64

One thing to note is that we have downloaded the file directly in the bin directory, you can do it separately as well. Once the file is downloaded make it executable by changing its permissions and for that use:

$ sudo chmod a+x /usr/local/bin/libtree

In order to determine whether this Kubernetes package management is installed properly after changing its permissions, check its version:

$ libtree --version

Now to remove this application from Linux Mint 21 then execute the below-mentioned command that will remove the executable file:

$ sudo rm -rf /usr/local/bin/libtree

Using libtree Command on Linux Mint 21

Since this tool is used to display the dependencies of a shared library or executable in a tree-like format so here is the syntax for using it:

$ libtree <path-of-directory/file/library>

For illustration we have performed an example for you by using the above syntax in which we have displayed mkdir dependences:

$ libtree -p /usr/bin/mkdir

Sometimes not all the dependencies are shown so to have a full information on the shared dependencies use the above-mentioned syntax with -v flag:

$ libtree -v -p /usr/bin/mkdir

Conclusion

The libtree is a shared dependencies displaying tool that can be termed as a substitute of ldd command on Linux. Further this tool can be installed on Linux Mint 21 by downloading its executable file from GitHub, and then moving it to /usr/local/bin directory.

About the author

Aaliyan Javaid

I am an electrical engineer and a technical blogger. My keen interest in embedded systems has led me to write and share my knowledge about them.