Recently, when I was tinkering with the Linux nc (netcat) command and executing nc -l 1567 to listen, I encountered the "protocol not available" error. After thinking for a long time, I finally found a viable solution:
- First, remove the installed nc:
yum erase nc
- Download the .rpm file of a lower version of nc:
wget http://vault.centos.org/6.6/os/x86\_64/Packages/nc-1.84-22.el6.x86\_64.rpm
- Install the .rpm file:
rpm -iUv nc-1.84-22.el6.x86_64.rpm
After executing the above steps, check if nc is installed properly, and then try executing nc -l 1567. 1567 is the port number, which can be freely specified within a certain range.
Problem analysis: After searching for information and tinkering for a long time, it seems that the newer version of nc has a bug. Therefore, I chose to downgrade the version to solve this issue. Of course, if there are any experts who have better solutions, please feel free to comment below and provide your solutions or suggestions. Thank you. ---------- The Linux system I am using is CentOS-6.4-x86_64-minimal.