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

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

## 安装

```sh
sudo av install brew:zenity
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install zenity
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install zenity
```

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

### Linux

- apk (92%):

```sh
sudo apk add zenity
```

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

- Debian apt (92%):

```sh
sudo apt install zenity
```

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

- dnf (92%):

```sh
sudo dnf install zenity
```

  证据: Fedora Rawhide package metadata: zenity 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#zenity
```

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

- pacman (92%):

```sh
sudo pacman -S zenity
```

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

- zypper (92%):

```sh
sudo zypper install zenity
```

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

## 软件包事实

- **软件包键:** brew:zenity
- **软件包管理器:** Homebrew
- **版本:** 4.2.2
- **来源摘要:** GTK+ dialog boxes for the command-line
- **主页:** <https://gitlab.gnome.org/GNOME/zenity>
- **最后更新:** 2026-07-07T14:59:01Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- zenity (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Zenity is GNOME's command-line bridge to GTK dialogs, letting shell scripts and other CLI workflows ask users questions, show progress, choose files, and display desktop notifications without writing a full graphical application.

### 项目历史

Zenity descends from GNOME's `gdialog` lineage. The GNOME README calls it the GNOME port of the venerable `dialog` program, while older BLFS documentation for Zenity 2.6.2 described it as a rewrite of gdialog, itself the GNOME port of dialog for displaying GTK+ dialog boxes from command-line scripts.

The old GNOME 2 era packaging already shipped both `gdialog` and `zenity`, with `gdialog` kept as a wrapper for legacy scripts. The modern repository still carries that role forward but has moved with the GNOME platform: the README identifies Zenity as part of GNOME Extra Apps and lists GTK 4 and libadwaita as current dependencies.

Because its purpose is deliberately small, Zenity has stayed stable in concept for decades: a CLI command that turns script state into desktop UI. Its evolution is mostly GNOME toolkit migration, option compatibility, and the set of supported dialog types.

### 采用历史

Zenity became widely adopted because it solved a packaging and scripting problem that neither pure terminal tools nor full GUI frameworks solved cleanly: a shell script could request desktop input using a standard GNOME/GTK utility. That made it attractive for installers, admin scripts, small desktop helpers, and distribution glue.

The supplied package data shows Zenity available across Homebrew, Debian, Ubuntu, Fedora, Alpine, MacPorts, Nix, Arch, and openSUSE-family packaging. That breadth reflects both its age and its continued usefulness as a tiny dependency for desktop-facing shell workflows.

### 使用方式

Common usage is direct from shell scripts: `zenity --info`, `--warning`, `--question`, `--entry`, `--file-selection`, `--progress`, `--list`, `--calendar`, and similar options show GTK dialogs and return either exit status or selected/input data to stdout.

Zenity is especially useful where a package maintainer or script author wants a lightweight graphical prompt without adding a bespoke GUI. It is less useful on headless systems or non-GTK desktop environments unless the needed display and runtime stack are present.

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

Zenity is a classic package-nerd utility because it sits at the boundary between CLI automation and desktop integration. It is often installed not because users launch it directly, but because scripts and packages want a standard, cross-language way to display GTK dialogs.

It is also a reminder that small desktop commands have long compatibility tails. The `gdialog` wrapper, old GNOME 2 documentation, modern GTK/libadwaita migration, and broad distro packaging all show how a tiny CLI can persist as infrastructure.

### 时间线

- GNOME 2 era: Zenity appears as the rewrite/replacement for gdialog while retaining a gdialog wrapper for legacy scripts.
- 2004: BLFS 5.1 documents Zenity 2.6.2 as a GNOME additional package for command-line GTK dialogs.
- 2020s: GNOME repository identifies Zenity as a GNOME Extra Apps project using GTK 4 and libadwaita.
- 2022: Oracle Solaris man page documents the broad Zenity/gdialog option set, including file selection, progress, list, forms, calendar, and notification dialogs.

### Related projects

- dialog is the text-mode dialog program that inspired the GNOME/GTK lineage.
- gdialog is Zenity's predecessor and legacy wrapper name.
- KDialog provides a comparable script-facing dialog tool in KDE environments.

### 来源

- <https://docs.oracle.com/cd/E88353_01/html/E37839/gdialog-1.html>
- <https://github.com/GNOME/zenity#readme>
- <https://www.linuxfromscratch.org/blfs/view/5.1/gnome/zenity.html>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - zenity - 4.1.90-1: normalized package name match | Debian stable package indexes: zenity from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Display graphical dialog boxes from shell scripts | https://wiki.gnome.org/Projects/Zenity
- Debian apt - zenity-common - 4.1.90-1: normalized package name match | Debian stable package indexes: zenity-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Display graphical dialog boxes from shell scripts (common files) | https://wiki.gnome.org/Projects/Zenity
- Nix - zenity: normalized package name match | nixpkgs package indexes: pkgs/by-name/ze/zenity/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - zenity - 4.0.1-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: zenity from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Display graphical dialog boxes from shell scripts | https://wiki.gnome.org/Projects/Zenity
- Ubuntu apt - zenity-common - 4.0.1-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: zenity-common from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Display graphical dialog boxes from shell scripts (common files) | https://wiki.gnome.org/Projects/Zenity
- apk - zenity - 4.2.2-r0: normalized package name match | Alpine Linux edge package indexes: zenity from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Display dialog boxes from the command line and shell scripts | https://gitlab.gnome.org/GNOME/zenity
- apk - zenity-dbg - 4.2.2-r0: normalized package name match | Alpine Linux edge package indexes: zenity-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Display dialog boxes from the command line and shell scripts (debug symbols) | https://gitlab.gnome.org/GNOME/zenity
- apk - zenity-doc - 4.2.2-r0: normalized package name match | Alpine Linux edge package indexes: zenity-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Display dialog boxes from the command line and shell scripts (documentation) | https://gitlab.gnome.org/GNOME/zenity
- apk - zenity-lang - 4.2.2-r0: normalized package name match | Alpine Linux edge package indexes: zenity-lang from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Languages for package zenity | https://gitlab.gnome.org/GNOME/zenity
- dnf - zenity - 4.2.2-5.fc45: normalized package name match | Fedora Rawhide package metadata: zenity from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Display dialog boxes from shell scripts | https://wiki.gnome.org/Projects/Zenity
- pacman - zenity - 4.2.2-1: normalized package name match | Arch Linux sync databases: zenity from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Display graphical dialog boxes from shell scripts | https://gitlab.gnome.org/GNOME/zenity
- zypper - zenity - 4.2.2-1.4: normalized package name match | openSUSE Tumbleweed package metadata: zenity from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | GNOME Command Line Dialog Utility | https://wiki.gnome.org/Projects/Zenity
- zypper - zenity-lang - 4.2.2-1.4: normalized package name match | openSUSE Tumbleweed package metadata: zenity-lang from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Translations for package zenity | https://wiki.gnome.org/Projects/Zenity
- MacPorts - zenity: normalized package name match | MacPorts ports tree: gnome/zenity/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/zenity.yml](https://github.com/mxcl/pkgdb/blob/main/combined/zenity.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
