How To Install golang-github-vishvananda-netlink-dev on Ubuntu 18.04

In this tutorial we learn how to install golang-github-vishvananda-netlink-dev on Ubuntu 18.04. golang-github-vishvananda-netlink-dev is netlink library for go

Introduction

In this tutorial we learn how to install golang-github-vishvananda-netlink-dev on Ubuntu 18.04.

golang-github-vishvananda-netlink-dev is:

The netlink package provides a simple netlink library for go. Netlink is the interface a user-space program in Linux uses to communicate with the kernel. It can be used to add and remove interfaces, set ip addresses and routes, and configure ipsec. Netlink communication requires elevated privileges, so in most cases this code needs to be run as root. Since low-level netlink messages are inscrutable at best, the library attempts to provide an API that is loosely modeled on the CLI provied by iproute2. Actions like ip link add will be accomplished via a similarly named function like AddLink(). This library began its life as a fork of the netlink functionality in docker/libcontainer but was heavily rewritten to improve testability, performance, and to add new functionality like ipsec xfrm handling.

This package contains the source.

There are three methods to install golang-github-vishvananda-netlink-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.

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

sudo apt-get update

After updating apt database, We can install golang-github-vishvananda-netlink-dev using apt-get by running the following command:

sudo apt-get -y install golang-github-vishvananda-netlink-dev

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install golang-github-vishvananda-netlink-dev using apt by running the following command:

sudo apt -y install golang-github-vishvananda-netlink-dev

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 golang-github-vishvananda-netlink-dev using aptitude by running the following command:

sudo aptitude -y install golang-github-vishvananda-netlink-dev

To uninstall only the golang-github-vishvananda-netlink-dev package we can use the following command:

sudo apt-get remove golang-github-vishvananda-netlink-dev

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

sudo apt-get -y autoremove golang-github-vishvananda-netlink-dev

To remove golang-github-vishvananda-netlink-dev configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge golang-github-vishvananda-netlink-dev

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

sudo apt-get -y autoremove --purge golang-github-vishvananda-netlink-dev

References

Summary

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