netcat-openbsd in RHEL/Centos (RPM)

There are two versions of netcat (nc) utility: netcat-openbsd and GNU netcat. For example, in some distributives like Debian or Arch user could choose which version of the package he/she would like to install. I was searching the internet but have not found how to install netcat-openbsd into a RHEL or CentOS system.

I would be grateful for the information if this is possible at all on such a system apart from compiling the package from the source code. Thanks.


Solution 1:

TL;DR: Compiling a netcat-openbsd package manually for RHEL seems currently the only way.

As of writing, RHEL 7 and 8 (and thus its derivates and downstreams) only provide Nmap ncat as part of the nmap-ncat package. With bug #1653119, I've already successfully requested for RHEL 8 (and unsuccessfully for RHEL 7) that /usr/bin/nc gets a symlink that can be managed using update-alternatives (and with PR#5 this hopefully should make it also into RHEL 9. My initial motivation were incompatibilities when Red Hat decided to switch from netcat-openbsd to nmap-ncat, though my interest in bringing netcat-openbsd back lowered when these were fixed in nmap-ncat. And as per bug #1321136 there was at least some other interest in OpenBSD netcat, but it looks like there was not enough Red Hat customer demand in the end.

Speaking from the perspective of an EPEL package maintainer, I am not aware about RPM packages for netcat-openbsd from a well-known public repository (and yes, I might not know all repositories out there), but with respect to the recent license uncertainty of nmap-ncat, I've catched up the topic again. Given I need TLS support in nc (which depends at OpenBSD on libtls), I've meanwhile packaged LibreTLS (which provides libtls for OpenSSL) that is currently waiting for a package review. The next step will be OpenBSD netcat itself, however I wouldn't hold my breath for it, depending on possible issues during the package review then. And if I don't forget it, I'll add a reference to the package review here, too. Thus building it yourself is likely the only way if you actually just need it.

Edit #1: LibreTLS passed the package review and is on the way to the repositories, OpenBSD netcat is meanwhile waiting for a package review.

Edit #2: OpenBSD netcat has meanwhile landed in the EPEL 7 and 8 stable repositories, thus yum install netcat should do the job (once the EPEL repository has been enabled).