How To Install libdwarf-dev on Ubuntu 18.04

In this tutorial we learn how to install libdwarf-dev on Ubuntu 18.04. libdwarf-dev is library to consume and produce DWARF debug information

Introduction

In this tutorial we learn how to install libdwarf-dev on Ubuntu 18.04.

What is libdwarf-dev

libdwarf-dev is:

The libdwarf package provides a library which allows reading/consuming and writing/producing of DWARF debugging information from object files, shared libraries, and executables.

This package contains developer resources for libdwarf. Install it if you want to develop software that uses the libdwarf API.

This library is part of dwarfutils.

There are three methods to install libdwarf-dev on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libdwarf-dev Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libdwarf-dev using apt-get by running the following command:

sudo apt-get -y install libdwarf-dev

Install libdwarf-dev Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libdwarf-dev using apt by running the following command:

sudo apt -y install libdwarf-dev

Install libdwarf-dev Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libdwarf-dev using aptitude by running the following command:

sudo aptitude -y install libdwarf-dev

How To Uninstall libdwarf-dev on Ubuntu 18.04

To uninstall only the libdwarf-dev package we can use the following command:

sudo apt-get remove libdwarf-dev

Uninstall libdwarf-dev And Its Dependencies

To uninstall libdwarf-dev and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libdwarf-dev

Remove libdwarf-dev Configurations and Data

To remove libdwarf-dev configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libdwarf-dev

Remove libdwarf-dev configuration, data, and all of its dependencies

We can use the following command to remove libdwarf-dev configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libdwarf-dev

References

Summary

In this tutorial we learn how to install libdwarf-dev package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.