Mac 安装 Telnet 工具

方案一

通过 brew install telnet 时会要求安装 xcode

安装命令

bash 复制代码
 brew install telnet

报错信息:

bash 复制代码
Warning: No remote 'origin' in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).

You have 11 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

Warning: You are using macOS 11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

telnet: A full installation of Xcode.app is required to compile
this software. Installing just the Command Line Tools is not sufficient.

Xcode can be installed from the App Store.
Error: telnet: An unsatisfied requirement failed this build.

如果出现以上错误,我们可以使用方案二

方案二

从 GNU 的 FTP 服务器下载 inetutils 源代码并编译安装 Telnet 是一个可行的方法。以下是详细的步骤来完成这个过程:

步骤 1: 下载 inetutils 源码

网页访问可以查看所有版本列表

bash 复制代码
https://ftp.gnu.org/gnu/inetutils/
  1. 打开终端。

  2. 使用 curl 或者 wget 命令下载你选择的版本,例如 inetutils-2.3.tar.xz:

    sh 复制代码
    curl -O https://ftp.gnu.org/gnu/inetutils/inetutils-2.3.tar.xz

    或者如果你更喜欢使用 wget

    sh 复制代码
    wget https://ftp.gnu.org/gnu/inetutils/inetutils-2.3.tar.xz

步骤 2: 解压源码包

  1. 安装 xz 工具(如果还没有安装)以便解压 .xz 文件:

    sh 复制代码
    brew install xz  # 如果你不想用 Homebrew,可以手动安装 xz 工具
  2. 解压文件:

    sh 复制代码
    tar -xvf inetutils-2.3.tar.xz
  3. 进入解压后的目录:

    sh 复制代码
    cd inetutils-2.3

步骤 3: 编译和安装 inetutils

  1. 配置编译选项。你可以通过运行 ./configure --help 来查看所有可用选项。这里我们使用默认配置:

    sh 复制代码
    ./configure
  2. 编译源码:

    sh 复制代码
    make
  3. 以管理员权限安装 inetutils(包括 Telnet):

    sh 复制代码
    sudo make install

步骤 4: 验证安装

  1. 在终端中输入 telnet 命令来检查是否成功安装了 Telnet 客户端。如果一切正常,你应该能看到 Telnet 的帮助信息或提示。

注意事项

  • 在执行 sudo make install 之前,请确保你知道自己在做什么,因为这会将 inetutils 安装到系统路径中,可能会影响现有的工具。
  • 如果你不希望覆盖系统的其他工具,或者想要保持安装的整洁,你可以考虑指定安装路径,比如 ./configure --prefix=/usr/local/inetutils,然后相应地调整你的 PATH 环境变量。
  • 请记得定期更新和维护你自己编译安装的软件,以确保它们的安全性和稳定性。

以上就是从源码安装 Telnet 的完整步骤。这样安装的 Telnet 可以作为日常使用的客户端。

相关推荐
小溪彼岸2 天前
macOS自带截图命令ScreenCapture
macos
TESmart碲视2 天前
Mac 真正多显示器支持:TESmart USB-C KVM(搭载 DisplayLink 技术)如何实现
macos·计算机外设·电脑
2501_915106323 天前
Xcode 上传 ipa 全流程详解 App Store 上架流程、uni-app 生成 ipa 文件上传与审核指南
android·macos·ios·小程序·uni-app·iphone·xcode
他们都不看好你,偏偏你最不争气3 天前
【iOS】AFNetworking
开发语言·macos·ios·objective-c
钟念3 天前
【打包app】uniapp打包ios端和安卓端app
macos·objective-c·cocoa
森之鸟3 天前
Mac电脑上如何打印出字体图标
前端·javascript·macos
m_136874 天前
Mac M 系列芯片 YOLOv8 部署教程(CPU/Metal 后端一键安装)
yolo·macos
搜狐技术产品小编20234 天前
CAEmitterLayer:iOS 中创建炫酷粒子效果的魔法工具
macos·ios·objective-c·cocoa
未来之窗软件服务5 天前
操作系统应用开发(七)mac苹果模拟器——东方仙盟练气期
macos·仙盟创梦ide·东方仙盟·系统模拟器
liliangcsdn5 天前
Mac本地docker安装Kibana+ElasticSearch
elasticsearch·macos·docker