# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, zypper 安装 uhubctl

查看 uhubctl 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:uhubctl
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install uhubctl
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install uhubctl
```

  证据: MacPorts ports tree: sysutils/uhubctl/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add uhubctl
```

  证据: Alpine Linux edge package indexes: uhubctl from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install uhubctl
```

  证据: Debian stable package indexes: uhubctl from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install uhubctl
```

  证据: Fedora Rawhide package metadata: uhubctl from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#uhubctl
```

  证据: nixpkgs package indexes: pkgs/by-name/uh/uhubctl/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install uhubctl
```

  证据: openSUSE Tumbleweed package metadata: uhubctl from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## 软件包事实

- **软件包键:** brew:uhubctl
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/uhubctl>
- **版本:** 2.6.0
- **来源摘要:** USB hub per-port power control
- **主页:** <https://github.com/mvp/uhubctl>
- **仓库:** <https://github.com/mvp/uhubctl>
- **上游文档:** <https://github.com/mvp/uhubctl>
- **许可证:** GPL-2.0-only
- **源码归档:** <https://github.com/mvp/uhubctl/archive/refs/tags/v2.6.0.tar.gz>
- **已生成:** 2026-07-08T18:08:21+00:00

## 可执行文件

- uhubctl (cli)
- uhubctl (别名)

## 依赖

- libusb

## 构建依赖

- pkgconf

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 2.6.0
- 本地数据: OK
- 上游仓库: https://github.com/mvp/uhubctl
- 检测到的最新版本: v2.6.0 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

uhubctl is a command-line utility for controlling per-port power on USB hubs that implement USB per-port power switching.

### 项目历史

The public uhubctl repository was created in 2015. Its README credits hub-ctrl.c by Niibe Yutaka as the original inspiration and defines the target hardware as smart USB hubs that can switch power per port.

The project grew around a practical compatibility table rather than only a codebase. The README tracks known working hubs, monitors, docks, keyboards, Raspberry Pi boards, and embedded devices, and asks users to report working hardware with uhubctl output and VBUS-off test results.

Release metadata shows v1.8 in 2017, v2.0.0 in 2018, a series of 2.x releases through 2022, and v2.6.0 in 2024.

### 采用历史

uhubctl's adoption is closely tied to lab automation, embedded development, Raspberry Pi work, USB device testing, and remote recovery workflows where physically unplugging a device is inconvenient. The README documents Raspberry Pi models and many external hubs and docks as compatible or partially compatible devices.

The supplied package data records uhubctl in Homebrew, MacPorts, Nix, Alpine, Debian, Ubuntu, Fedora/dnf, and openSUSE. The official README likewise lists package-manager install commands for macOS, Debian-family systems, Red Hat-family systems, openSUSE, and FreeBSD.

### 使用方式

The common command form is to list supported hubs, then turn a selected port off, on, toggle it, or cycle it with a configurable delay. The README documents location selection for multi-hub systems and cautions that switching built-in USB ports can disconnect keyboards or mice.

On Linux, the README documents udev rules for non-root access and notes that Linux kernel 6.0 and later provide a standard interface for disabling hub ports, which uhubctl tries to use instead of libusb where possible.

The README also explains USB 3.0 duality: a USB 3 hub can appear as separate USB2 and USB3 virtual hubs, and power changes may need to be applied to both for the physical port state to match the user's expectation.

### 为什么软件包爱好者会关心

uhubctl is significant because it turns a hardware capability that is inconsistently implemented by consumer devices into a scriptable package-manager tool. That makes it useful for test rigs, CI benches with attached hardware, home labs, and headless systems.

For packagers, the interesting part is not just compiling a small C program; it is carrying libusb behavior, OS-specific permissions, kernel interface changes, and documentation for hardware quirks that determine whether the command actually cuts power.

### 时间线

- 2015: Public GitHub repository created.
- 2017: v1.8 release published.
- 2018: v2.0.0 release published.
- 2020: v2.2.0 and v2.3.0 releases published.
- 2022: v2.5.0 release published.
- 2024: v2.6.0 release published.

### Related projects

- The README names hub-ctrl.c by Niibe Yutaka as the original inspiration.
- uhubctl depends on libusb for portable USB access and, on newer Linux kernels, can use the kernel port-disable interface.

### 来源

- <https://api.github.com/repos/mvp/uhubctl>
- <https://api.github.com/repos/mvp/uhubctl/releases?per_page=10>
- <https://github.com/mvp/uhubctl>
- <https://raw.githubusercontent.com/mvp/uhubctl/master/README.md>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** uhubctl
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Debian apt - uhubctl - 2.6.0-1: normalized package name match | Debian stable package indexes: uhubctl from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | USB hub per-port power control | https://github.com/mvp/uhubctl
- Nix - uhubctl: normalized package name match | nixpkgs package indexes: pkgs/by-name/uh/uhubctl/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - uhubctl - 2.5.0-1: normalized package name match | Ubuntu 24.04 LTS package indexes: uhubctl from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | USB hub per-port power control | https://github.com/mvp/uhubctl
- apk - uhubctl - 2.5.0-r0: normalized package name match | Alpine Linux edge package indexes: uhubctl from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | USB hub per-port power control | https://github.com/mvp/uhubctl
- dnf - uhubctl - 2.6.0-5.fc44: normalized package name match | Fedora Rawhide package metadata: uhubctl from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | USB hub per-port power control | https://github.com/mvp/uhubctl
- zypper - uhubctl - 2.6.0-1.5: normalized package name match | openSUSE Tumbleweed package metadata: uhubctl from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | USB hub per-port power control | https://github.com/mvp/uhubctl
- MacPorts - uhubctl: normalized package name match | MacPorts ports tree: sysutils/uhubctl/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/zh-hans/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Homebrew utility packages](https://www.automicvault.com/zh-hans/pkg/brew-utility-packages/) - Matched Homebrew package provider.
- [pkgconf](https://www.automicvault.com/zh-hans/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [sispmctl](https://www.automicvault.com/zh-hans/pkg/brew/sispmctl/) - Shares av.db curated category or tags: cli, hardware, hardware-control, power-control, system.
- [blink1](https://www.automicvault.com/zh-hans/pkg/brew/blink1/) - Shares av.db curated category or tags: cli, hardware, system, usb.
- [cyme](https://www.automicvault.com/zh-hans/pkg/brew/cyme/) - Shares av.db curated category or tags: cli, hardware, system, usb.
- [lsusb](https://www.automicvault.com/zh-hans/pkg/brew/lsusb/) - Shares av.db curated category or tags: cli, hardware, system, usb.
- [quadcastrgb](https://www.automicvault.com/zh-hans/pkg/brew/quadcastrgb/) - Shares av.db curated category or tags: cli, hardware-control, system.
- [rkflashtool](https://www.automicvault.com/zh-hans/pkg/brew/rkflashtool/) - Shares av.db curated category or tags: cli, hardware, system, usb.
- [usbutils](https://www.automicvault.com/zh-hans/pkg/brew/usbutils/) - Shares av.db curated category or tags: cli, hardware, system, usb.
- [bootloadhid](https://www.automicvault.com/zh-hans/pkg/brew/bootloadhid/) - Shares av.db curated category or tags: cli, system, usb.
- [liquidctl](https://www.automicvault.com/zh-hans/pkg/brew/liquidctl/) - Local package facts share a topical domain. Shared terms: cli, control, hardware, libusb, system.
- [dfu-programmer](https://www.automicvault.com/zh-hans/pkg/brew/dfu-programmer/) - Local package facts share a topical domain. Shared terms: cli, libusb, system, usb.
- [libgusb](https://www.automicvault.com/zh-hans/pkg/brew/libgusb/) - Local package facts share a topical domain. Shared terms: cli, libusb, system, usb.

## Combined YAML source

View the package source record on GitHub. [combined/uhubctl.yml](https://github.com/automic-vault/db/blob/main/combined/uhubctl.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
