Manjaro 安装netcat---nc网络检测工具

在其他发行版上默认nc都有安装,或者通过apt或dnf等都可以安装使用,而在Manajaro上,通过软件包管理器搜索安装netcat会出现失败报错,于是只能通过git下载,构建本地AUR包才能正常完成安装

在这里插入图片描述

  • git下载
git https://aur.archlinux.org/libressl-netcat.git 
git: 'https://aur.archlinux.org/libressl-netcat.git' is not a git command. See 'git --help'.
[jay@jay-pc ~]$ git clone https://aur.archlinux.org/libressl-netcat.git 
Cloning into 'libressl-netcat'...
remote: Enumerating objects: 88, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 88 (delta 18), reused 88 (delta 18)
Unpacking objects: 100% (88/88), done.

  • 进入到libressl-netcat目录,执行makepkg
make[1]: Leaving directory '/home/jay/Downloads/libressl-netcat/src/libressl-2.8.3'
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "libressl-netcat"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: libressl-netcat 2.8.3-2 (2019年12月02日 星期一 17时20分47秒)

  • 构建完成后,生成本地软件包libressl-netcat-2.8.3-2-x86_64.pkg.tar.xz
ls -l
total 3928
-rw-r--r-- 1 jay jay 3366196 12月  2 17:18 libressl-2.8.3.tar.gz
-rw-r--r-- 1 jay jay     801 12月  2 17:18 libressl-2.8.3.tar.gz.asc
-rw-r--r-- 1 jay jay  635768 12月  2 17:20 libressl-netcat-2.8.3-2-x86_64.pkg.tar.xz
drwxr-xr-x 3 jay jay    4096 12月  2 17:20 pkg
-rw-r--r-- 1 jay jay    1555 12月  2 17:15 PKGBUILD
drwxr-xr-x 3 jay jay    4096 12月  2 17:18 src

  • 通过软件包管理器安装这个软件包,安装成功后就可以直接在shell执行nc工具命令了
libressl-netcat]$ nc
usage: nc [-46cDdFhklNnrStUuvz] [-C certfile] [-e name] [-H hash] [-I length]
	  [-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]
	  [-o staplefile] [-P proxy_username] [-p source_port] [-R CAfile]
	  [-s source] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
	  [-X proxy_protocol] [-x proxy_address[:port]] [-Z peercertfile]
	  [destination] [port]

nc -vz www.baidu.com 80
Connection to www.baidu.com 80 port [tcp/http] succeeded!
nc -vzu 114.114.114.114 53
Connection to 114.114.114.114 53 port [udp/domain] succeeded!

你可能感兴趣的:(Manjaro)