Linux – Netcat fails to start in listening mode

centoslinuxnetcattcp

I'm using CentOS 6.7 (Final) system, and when I try to run nc in listening mode it prints the following:

# nc -l 1234
nc: Protocol not available

The port is not bound. I tried other port numbers too.
This bug seem to have been reported already: https://access.redhat.com/solutions/1753753. Unfortunately it is not very detailed.

Package information:

Name        : nc
Arch        : x86_64
Version     : 1.84
Release     : 24.el6

Is there something else I need to try out?

Best Answer

I ran into the same issue. You can solve it this way:

# Removes the old package
yum erase nc

# Manually downloads the working package from the Official Repository
wget http://vault.centos.org/6.6/os/x86_64/Packages/nc-1.84-22.el6.x86_64.rpm

# Installs the package
rpm -iUv nc-1.84-22.el6.x86_64.rpm

Please note that the package is for x86_64 (64-bit). If you need i386 (32-bit), the correct one is:

wget http://vault.centos.org/6.6/os/i386/Packages/nc-1.84-22.el6.i686.rpm