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

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

## 安装

```sh
sudo av install brew:zbar
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install zbar
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install zbar
```

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

### Linux

- apk (92%):

```sh
sudo apk add zbar
```

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

- dnf (92%):

```sh
sudo dnf install zbar
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#zbar
```

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

- pacman (92%):

```sh
sudo pacman -S zbar
```

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

- zypper (92%):

```sh
sudo zypper install zbar
```

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

- Debian apt (92%):

```sh
sudo apt install gir1.2-zbar-1.0
```

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

## 软件包事实

- **软件包键:** brew:zbar
- **软件包管理器:** Homebrew
- **版本:** 0.23.93
- **来源摘要:** Suite of barcodes-reading tools
- **主页:** <https://linuxtv.org/downloads/zbar/>
- **仓库:** <https://github.com/mchehab/zbar>
- **最后更新:** 2026-07-13T10:42:34Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- zbarimg (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.23.93
## 项目历史与用法

ZBar is an open-source C barcode and QR-code reader suite with command-line tools, camera and image scanners, GUI bindings, and language bindings used by desktop applications, scripts, and packaging ecosystems.

### 项目历史

The project began as Zebra, with version 0.1 in 2007 supporting basic EAN-13 and UPC-A scanning from a webcam or stored image files through `zebracam` and `zebraimg`. The 0.7 release in 2009 finalized the name change to ZBar and added Python bindings.

ZBar expanded quickly in 2008-2009: releases added Code 128, Video4Linux2 support, more image formats, GTK/PyGTK/Qt widgets, EAN-8, Code 39, Interleaved 2 of 5, Windows command-line ports, and QR Code support in 0.10. The SourceForge site presented it as a suite for reading bar codes from video streams, image files, and raw intensity sensors.

After the old upstream line stalled, Mauro Carvalho Chehab created a LinuxTV-hosted fork. NEWS.md says 0.20 in 2017 was created because upstream had no version since 2009, and focused on modern Video4Linux2 support via libv4l2, Qt5 compatibility, and new zbarcam GUI applications.

The maintained 0.23 line modernized ZBar for newer libraries: Gtk2 or Gtk3, Python2 or Python3, GObject Introspection bindings, Windows DirectShow support, and continued command-line/library use.

### 采用历史

ZBar became a common Unix packaging dependency because it is both a library and a tool suite. Distributions can ship `zbarimg` for scanning image files, `zbarcam` for webcams, development headers, and bindings used by Python, Perl, Ruby, Qt, GTK, and GObject-based applications.

Its adoption is especially visible in wrappers such as pyzbar and in distro packages that expose ZBar through GIR, Python, Qt, GTK, and CLI subpackages. That breadth kept the project relevant even when the original SourceForge release line slowed down.

The LinuxTV fork is an adoption story in itself: webcam APIs and GUI stacks changed under ZBar, so package maintainers needed a maintained upstream that could keep barcode scanning working on current kernels, desktops, Python versions, and Windows capture APIs.

### 使用方式

Users run `zbarimg` against screenshots, photos, PDFs, or generated image files, or use `zbarcam` to scan a Video4Linux camera stream and print decoded symbols to standard output. Application developers link libzbar or use bindings when barcode recognition needs to be embedded in another program.

Supported symbologies across the project history include EAN/UPC variants, Code 128, Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code, and later SQ Code. The common packaging value is that a script or app can delegate messy image/camera barcode decoding to a small native library.

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

ZBar is package-nerd significant because it is a textbook survivor package: a small C library plus CLI tools, bindings across languages, GUI integrations, and a fork that exists largely to keep old useful functionality compiling and working on modern systems.

It also shows why package metadata can hide real complexity. A formula called `zbar` may look like a simple barcode tool, but downstreams care about webcam backends, image libraries, Python and GIR bindings, Qt/GTK optionality, Windows capture support, and security fixes for untrusted QR/image parsing.

### 时间线

- 2007-03-24: First official Zebra 0.1 release, with basic webcam and image-file scanning.
- 2009-04-21: Version 0.7 finalized the project name change to ZBar and added Python bindings.
- 2009-08-31: Version 0.9 introduced Windows command-line application ports.
- 2009-10-23: Version 0.10 added QR Code support.
- 2017-04-11: Version 0.20 launched the LinuxTV fork after the old upstream line had no version since 2009.
- 2019: Versions 0.21 through 0.23 modernized compiler, Windows, Java, Gtk, Python, GIR, and DirectShow support.

### Related projects

- Related projects include pyzbar, Barcode::ZBar, zbarlight, ZXing, QR/barcode scanner applications, Video4Linux, libv4l2, GTK, Qt, GObject Introspection, and distro packages that split ZBar into CLI, library, and binding components.

### 来源

- <https://man.archlinux.org/man/extra/zbar/zbarcam.1.en>
- <https://metacpan.org/pod/Barcode%3A%3AZBar>
- <https://pypi.org/project/pyzbar/>
- <https://raw.githubusercontent.com/mchehab/zbar/master/NEWS.md>
- <https://raw.githubusercontent.com/mchehab/zbar/master/README.md>
- <https://zbar.sourceforge.net/>
- <https://zbar.sourceforge.net/about.html>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - gir1.2-zbar-1.0 - 0.23.93-8: normalized package name match | Debian stable package indexes: gir1.2-zbar-1.0 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (introspection data) | https://github.com/mchehab/zbar
- Debian apt - libbarcode-zbar-perl - 0.23.93-8: normalized package name match | Debian stable package indexes: libbarcode-zbar-perl from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (Perl bindings) | https://github.com/mchehab/zbar
- Debian apt - libzbar-dev - 0.23.93-8: normalized package name match | Debian stable package indexes: libzbar-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (development) | https://github.com/mchehab/zbar
- Debian apt - libzbar0t64 - 0.23.93-8: normalized package name match | Debian stable package indexes: libzbar0t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (library) | https://github.com/mchehab/zbar
- Debian apt - libzbargtk-dev - 0.23.93-8: normalized package name match | Debian stable package indexes: libzbargtk-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (GTK+ bindings development) | https://github.com/mchehab/zbar
- Debian apt - libzbargtk0t64 - 0.23.93-8: normalized package name match | Debian stable package indexes: libzbargtk0t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (GTK+ bindings) | https://github.com/mchehab/zbar
- Debian apt - libzbarqt-dev - 0.23.93-8: normalized package name match | Debian stable package indexes: libzbarqt-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (Qt binding development) | https://github.com/mchehab/zbar
- Debian apt - libzbarqt0t64 - 0.23.93-8: normalized package name match | Debian stable package indexes: libzbarqt0t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (Qt binding) | https://github.com/mchehab/zbar
- Debian apt - python3-zbar - 0.23.93-8: normalized package name match | Debian stable package indexes: python3-zbar from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (Python bindings) | https://github.com/mchehab/zbar
- Debian apt - zbar-tools - 0.23.93-8: normalized package name match | Debian stable package indexes: zbar-tools from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (utilities) | https://github.com/mchehab/zbar
- Debian apt - zbarcam-gtk - 0.23.93-8: normalized package name match | Debian stable package indexes: zbarcam-gtk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (Gtk camera tool) | https://github.com/mchehab/zbar
- Debian apt - zbarcam-qt - 0.23.93-8: normalized package name match | Debian stable package indexes: zbarcam-qt from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | QR code / bar code scanner and decoder (Qt camera tool) | https://github.com/mchehab/zbar
- Nix - zbar: normalized package name match | nixpkgs package indexes: pkgs/by-name/zb/zbar/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - gir1.2-zbar-1.0 - 0.23.93-4build3: normalized package name match | Ubuntu 24.04 LTS package indexes: gir1.2-zbar-1.0 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | QR code / bar code scanner and decoder (introspection data) | https://github.com/mchehab/zbar
- Ubuntu apt - libbarcode-zbar-perl - 0.23.93-4build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libbarcode-zbar-perl from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | QR code / bar code scanner and decoder (Perl bindings) | https://github.com/mchehab/zbar
- Ubuntu apt - libzbar-dev - 0.23.93-4build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libzbar-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | QR code / bar code scanner and decoder (development) | https://github.com/mchehab/zbar


## Combined YAML source

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


## 来源

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