socket_getnameinfo command not found

In this troubleshooting guide we learn how to fix socket_getnameinfo command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

socket_getnameinfo: command not found

or when using sudo you get the following error message

sudo: socket_getnameinfo: command not found

Solutions to socket_getnameinfo: command not found

How To Fix socket_getnameinfo: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu socket_getnameinfo is provided by libsocket-getaddrinfo-perl package.

libsocket-getaddrinfo-perl is:

Socket::GetAddrInfo provides a Perl implementation of the getaddrinfo and getnameinfo functions as described in RFC 2553. These functions are useful for converting between a pair of host name/service name and socket addresses, or vice versa.

This module uses underlying C code to do most of the work if possible, but can also fall back on some mostly-compatible emulation code written in Perl. This means that this module is a fairly portable implementation of these functions.

As of Perl version 5.14.0, Perl already supports getaddrinfo' in core. On such a system, this module simply uses the functions provided by Socket’, and does not need to use its own compiled XS, or pure-perl legacy emulation.

As Socket' in core now provides all the functions also provided by this module, it is likely this may be the last released version of this module. And code currently using this module would be advised to switch to using core Socket’ instead.

To fix this problem, we can install more using the command below.

sudo apt-get -y install libsocket-getaddrinfo-perl

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install libsocket-getaddrinfo-perl.

sudo apt -y install libsocket-getaddrinfo-perl

Or if you have aptitude installed you can use the following command.

sudo aptitude install libsocket-getaddrinfo-perl

Summary

In this tutorial we learn how to fix socket_getnameinfo command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.