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

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

## 安装

```sh
sudo av install brew:libmtp
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libmtp
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libmtp
```

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

### Linux

- apk (92%):

```sh
sudo apk add libmtp
```

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

- dnf (92%):

```sh
sudo dnf install libmtp
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#libmtp
```

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

- pacman (92%):

```sh
sudo pacman -S libmtp
```

  证据: Arch Linux sync databases: libmtp from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Debian apt (92%):

```sh
sudo apt install libmtp-common
```

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

- zypper (92%):

```sh
sudo zypper install libmtp-devel
```

  证据: openSUSE Tumbleweed package metadata: libmtp-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:libmtp
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/libmtp>
- **版本:** 1.1.23
- **来源摘要:** Implementation of Microsoft's Media Transfer Protocol (MTP)
- **主页:** <https://libmtp.sourceforge.net/>
- **上游文档:** <https://libmtp.sourceforge.net/>
- **许可证:** LGPL-2.1-or-later
- **源码归档:** <https://downloads.sourceforge.net/project/libmtp/libmtp/1.1.23/libmtp-1.1.23.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- mtp-albumart (cli)
- mtp-albums (cli)
- mtp-connect (cli)
- mtp-delfile (cli)
- mtp-detect (cli)
- mtp-emptyfolders (cli)
- mtp-files (cli)
- mtp-filetree (cli)
- mtp-folders (cli)
- mtp-format (cli)
- mtp-getfile (cli)
- mtp-getplaylist (cli)
- mtp-hotplug (cli)
- mtp-newfolder (cli)
- mtp-newplaylist (cli)
- mtp-playlists (cli)
- mtp-reset (cli)
- mtp-sendfile (cli)
- mtp-sendtr (cli)
- mtp-thumb (cli)
- mtp-tracks (cli)
- mtp-trexist (cli)
- mtp-albumart (别名)
- mtp-albums (别名)
- mtp-connect (别名)
- mtp-delfile (别名)
- mtp-detect (别名)
- mtp-emptyfolders (别名)
- mtp-files (别名)
- mtp-filetree (别名)
- mtp-folders (别名)
- mtp-format (别名)
- mtp-getfile (别名)
- mtp-getplaylist (别名)
- mtp-hotplug (别名)
- mtp-newfolder (别名)
- mtp-newplaylist (别名)
- mtp-playlists (别名)
- mtp-reset (别名)
- mtp-sendfile (别名)
- mtp-sendtr (别名)
- mtp-thumb (别名)
- mtp-tracks (别名)
- mtp-trexist (别名)

## 依赖

- libusb

## 构建依赖

- pkgconf

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.1.23
- 本地数据: OK
- 上游仓库: https://libmtp.sourceforge.net/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

libmtp is a POSIX-oriented C implementation of the Media Transfer Protocol initiator side: host software talks to MTP responders such as media players, phones, and other portable devices.

### 项目历史

The project grew around the practical problem that MTP devices are not normal mounted filesystems. The upstream homepage describes libmtp as an initiator implementation of MTP Basic, and the README explains the difference between a host-side initiator and a device-side responder.

Copyright notices in the public headers and examples show active authorship beginning in 2005, including Linus Walleij and other contributors. Over time the project accumulated a large device database, examples, command-line tools, and downstream integrations for desktop environments and media applications.

### 采用历史

The libmtp homepage explicitly lists downstreams and related clients such as GVFS MTP support for GNOME, KIO-MTP for KDE, go-mtpfs, XNJB, Gnomad2, Amarok, and Rhythmbox. That downstream list captures why the library became the common Unix packaging point for MTP access.

Package managers ship both the shared library and many small mtp-* utilities, letting users inspect devices, transfer files, manage playlists, and debug unknown vendor/product IDs without writing code.

### 使用方式

Typical usage is through desktop file managers, media players, FUSE clients, or the bundled commands such as mtp-detect, mtp-files, mtp-getfile, and mtp-sendfile. The upstream site asks users with unrecognized devices to submit USB IDs and mtp-detect output, reflecting the device-quirk maintenance model.

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

libmtp matters to packagers because it turns a messy device protocol and vendor-ID database into one shared dependency. It is also a classic example of a library whose command-line tools are as important for debugging support tickets as the library ABI is for applications.

### 时间线

- 2005: Public source copyright notices begin for libmtp authorship and examples.
- 2007: Additional contributors and device support appear in public source copyright notices.
- 2008: Several libmtp source files record continued authorship and device-support work.
- 2010s: GNOME, KDE, FUSE, and media-player clients use libmtp or related MTP access paths.
- 2020s: The project maintains SourceForge and GitHub source surfaces plus release packaging across Unix distributions.

### Related projects

- libmtp is related to libgphoto2's PTP/MTP handling, but the README explains that libmtp stays closer to the MTP object model rather than presenting everything as files. Desktop integrations include GVFS and KIO-MTP, while go-mtpfs and XNJB are standalone client examples.

### 来源

- <https://formulae.brew.sh/formula/libmtp>
- <https://github.com/libmtp/libmtp>
- <https://github.com/libmtp/libmtp/blob/master/src/libmtp.h.in>
- <https://libmtp.sourceforge.net/>
- <https://sourceforge.net/p/libmtp/code/ci/HEAD/tree/README>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 源数据库详情

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

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

- Debian apt - libmtp-common - 1.1.22-1: normalized package name match | Debian stable package indexes: libmtp-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Media Transfer Protocol (MTP) common files | https://libmtp.sourceforge.net/
- Debian apt - libmtp-dev - 1.1.22-1: normalized package name match | Debian stable package indexes: libmtp-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Media Transfer Protocol (MTP) development files | https://libmtp.sourceforge.net/
- Debian apt - libmtp-doc - 1.1.22-1: normalized package name match | Debian stable package indexes: libmtp-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Media Transfer Protocol (MTP) library documentation | https://libmtp.sourceforge.net/
- Debian apt - libmtp-runtime - 1.1.22-1: normalized package name match | Debian stable package indexes: libmtp-runtime from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Media Transfer Protocol (MTP) runtime tools | https://libmtp.sourceforge.net/
- Debian apt - libmtp9t64 - 1.1.22-1: normalized package name match | Debian stable package indexes: libmtp9t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Media Transfer Protocol (MTP) library | https://libmtp.sourceforge.net/
- Debian apt - mtp-tools - 1.1.22-1: normalized package name match | Debian stable package indexes: mtp-tools from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Media Transfer Protocol (MTP) library tools | https://libmtp.sourceforge.net/
- Nix - libmtp: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libmtp/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libmtp-common - 1.1.21-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libmtp-common from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Media Transfer Protocol (MTP) common files | https://libmtp.sourceforge.net/
- Ubuntu apt - libmtp-dev - 1.1.21-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libmtp-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Media Transfer Protocol (MTP) development files | https://libmtp.sourceforge.net/
- Ubuntu apt - libmtp-doc - 1.1.21-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libmtp-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Media Transfer Protocol (MTP) library documentation | https://libmtp.sourceforge.net/
- Ubuntu apt - libmtp-runtime - 1.1.21-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libmtp-runtime from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Media Transfer Protocol (MTP) runtime tools | https://libmtp.sourceforge.net/
- Ubuntu apt - libmtp9t64 - 1.1.21-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libmtp9t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Media Transfer Protocol (MTP) library | https://libmtp.sourceforge.net/
- Ubuntu apt - mtp-tools - 1.1.21-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: mtp-tools from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Media Transfer Protocol (MTP) library tools | https://libmtp.sourceforge.net/
- apk - libmtp - 1.1.22-r1: normalized package name match | Alpine Linux edge package indexes: libmtp from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Software library for MTP media players | https://libmtp.sourceforge.net/
- apk - libmtp-dev - 1.1.22-r1: normalized package name match | Alpine Linux edge package indexes: libmtp-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Software library for MTP media players (development files) | https://libmtp.sourceforge.net/
- apk - libmtp-examples - 1.1.22-r1: normalized package name match | Alpine Linux edge package indexes: libmtp-examples from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Example programs for libmtp | https://libmtp.sourceforge.net/


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Media and graphics packages](https://pkg.so/zh-hans/media-graphics-tools/) - Matched media, image, audio, video, or graphics metadata.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [simple-mtpfs](https://pkg.so/zh-hans/brew/simple-mtpfs/) - Popular package that depends on this formula.
- [openexr](https://pkg.so/zh-hans/brew/openexr/) - Shares pkgdb curated category or tags: cli, library, media.
- [imagemagick](https://pkg.so/zh-hans/brew/imagemagick/) - Shares pkgdb curated category or tags: cli, library, media.
- [graphite2](https://pkg.so/zh-hans/brew/graphite2/) - Shares pkgdb curated category or tags: cli, library, media.
- [libvmaf](https://pkg.so/zh-hans/brew/libvmaf/) - Shares pkgdb curated category or tags: cli, library, media.
- [poppler](https://pkg.so/zh-hans/brew/poppler/) - Shares pkgdb curated category or tags: cli, library, media.
- [libheif](https://pkg.so/zh-hans/brew/libheif/) - Shares pkgdb curated category or tags: cli, library, media.
- [libavif](https://pkg.so/zh-hans/brew/libavif/) - Shares pkgdb curated category or tags: cli, library, media.
- [jasper](https://pkg.so/zh-hans/brew/jasper/) - Shares pkgdb curated category or tags: cli, library, media.
- [libgphoto2](https://pkg.so/zh-hans/brew/libgphoto2/) - Local package facts share a topical domain. Shared terms: cli, libusb, media, mtp.
- [pcl](https://pkg.so/zh-hans/brew/pcl/) - Local package facts share a topical domain. Shared terms: cli, library, libusb, media.
- [lib3ds](https://pkg.so/zh-hans/brew/lib3ds/) - Local package facts share a topical domain. Shared terms: cli, files, format, library, media.

## Combined YAML source

View the package source record on GitHub. [combined/libmtp.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libmtp.yml)


## 来源

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