如何在macOS High Sierra上安装开源Samba工具smbget?Homebrew暂不提供
Got it, let's dive in: you're absolutely correct that Homebrew doesn't provide smbget or the full Samba suite right now. As a quick reminder, smbget is a part of the Samba toolkit—its whole schtick is being a wget-like utility for downloading files from SMB servers, using smb:// URLs (for example, smb://host/share/file maps to the standard UNC path \\HOST\SHARE\file).
Here are the easiest ways to get it set up on your Mac:
Method 1: Use MacPorts (Most Straightforward)
MacPorts still maintains the complete Samba package that includes smbget. Here's how to install it:
- First, if you don't have MacPorts installed yet, grab the official installer and set it up.
- Open Terminal and run this command to install Samba (and smbget along with it):
sudo port install samba
Once the install finishes, you can start using smbget right away with all the syntax you're familiar with.
Method 2: Compile Samba from Source (For Those Who Prefer DIY)
If package managers aren't your thing, compiling from source works too—though it's a bit more hands-on:
- First, install Xcode Command Line Tools (required for compiling software):
xcode-select --install - Grab the latest stable Samba source code tarball from the official Samba project.
- Extract the tarball, navigate to the extracted folder in Terminal, then run these commands one after another:
./configure --prefix=/usr/local make sudo make install
After this, smbget will live in /usr/local/bin, which should already be in your system's PATH, so you can call it from any Terminal window.
Quick Side Note
While macOS does have built-in SMB tools like smbutil, they don't replicate smbget's wget-style workflow. So the methods above are the best way to get the exact tool you need.
内容的提问来源于stack exchange,提问作者Sybil

