Automic VaultAutomic Vault

brew

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

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

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install bash

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install bash

MacPorts ports tree · shells/bash/Portfile · 来源: api.github.com

Linux

Alpine Linux apk已验证 · 92%
sudo apk add bash

Alpine Linux edge package indexes · bash · 来源: dl-cdn.alpinelinux.org

Debian apt已验证 · 92%
sudo apt install bash

Debian stable package indexes · bash · 来源: deb.debian.org

Fedora dnf已验证 · 92%
sudo dnf install bash

Fedora Rawhide package metadata · bash · 来源: dl.fedoraproject.org

Nix已验证 · 92%
nix profile install nixpkgs#bash

nixpkgs package indexes · bash · 来源: raw.githubusercontent.com

Arch Linux pacman已验证 · 92%
sudo pacman -S bash

Arch Linux sync databases · bash · 来源: geo.mirror.pkgbuild.com

openSUSE zypper已验证 · 92%
sudo zypper install bash

openSUSE Tumbleweed package metadata · bash · 来源: download.opensuse.org

概览

软件包摘要

Bourne-Again SHell, a UNIX command interpreter

命令和别名

  • bash
  • bashbug

历史

项目历史与用法

GNU Bash, the Bourne-Again SHell, is the GNU Project's command language interpreter and one of the defining packages of Unix-like systems. It is both an interactive shell and a scripting language, sitting in the path between POSIX `sh`, the historical Bourne shell, GNU userlands, Linux distributions, macOS compatibility, and modern CI automation.

项目历史

The GNU Bash manual describes Bash as the shell for the GNU operating system and explains that its name is a pun on the Bourne shell, the traditional Unix shell written by Stephen Bourne. Chet Ramey's Bash information page describes Bash as a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command-line editing, job control, history substitution, brace expansion, and many other features.

Bash became the practical GNU answer to `/bin/sh`: compatible enough for shell scripts, featureful enough for interactive use, and free software under the GNU General Public License. The official Bash page identifies the Savannah repository as the main Git repository and the GNU FTP area as the archive for previous releases.

Bash history is also readline history. The package's interactive identity is built around line editing, history, completion, job control, shell variables, functions, and startup files. The official manual's startup-file section documents the familiar split between login files such as `~/.bash_profile`, `~/.bash_login`, and `~/.profile`, interactive non-login `~/.bashrc`, and non-interactive `BASH_ENV`.

采用历史

Bash became standard infrastructure across GNU/Linux distributions. Chet Ramey's distribution notes state directly that Bash is the standard shell on GNU/Linux systems, and the batch input shows it packaged across Alpine, Homebrew, Debian, Fedora/DNF, MacPorts, Nix, Arch, Ubuntu, and openSUSE.

Its adoption also spread beyond GNU/Linux. The official Bash page documents Bash in BSD ports/packages, macOS as `/bin/sh` and `/bin/bash` beginning with Jaguar/Mac OS X 10.2, Solaris, AIX, HP-UX, Minix, Cygwin, and Windows Subsystem for Linux environments. The same page notes Apple's long-lived Bash 3.2 choice, which made Homebrew and MacPorts important for users who wanted newer Bash on macOS.

Bash also became a de facto automation substrate. Makefiles, configure scripts, release scripts, CI pipelines, container entrypoints, package build recipes, dotfiles, and system administration scripts often assume either POSIX shell behavior or Bash-specific extensions. That ubiquity is why a shell package can be both boring and critical.

使用方式

Users run Bash interactively as a login shell or terminal shell, execute scripts with `bash script`, use it as a POSIX-like `/bin/sh` implementation when invoked that way, and customize sessions through startup files. The manual documents command invocation, startup-file behavior, variables, builtins, functions, shell expansions, redirection, job control, completion, and POSIX mode.

For package managers, Bash is also build infrastructure. Formulae, ports, distro build scripts, test harnesses, and upstream install scripts routinely rely on it. Installing Bash from Homebrew on macOS is a common way to get a newer GNU Bash than Apple's system `/bin/bash`, while Linux packages keep it in the base system dependency graph.

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

Bash is package-nerd bedrock. It is not just a package you install; it is a package many other packages assume exists during configure, build, test, install, and runtime scripting. A broken Bash upgrade can affect interactive users, init scripts, CI jobs, package formulas, and build systems all at once.

It is also one of the clearest examples of interface stability as a cultural contract. Bash has POSIX compatibility, decades of scripts, GNU extensions, platform-specific patches, startup-file expectations, and security-sensitive parsing behavior. Package maintainers care about patch levels, default paths, shell registration, codesigning or sandbox constraints on macOS, and whether `/bin/sh` points to Bash, dash, or another shell.

Historically, Bash carries the GNU/Linux story in one executable: free replacement shell, interactive convenience layer, script language, and distribution default. It is why package nerds still argue about Bashisms, POSIX portability, shebangs, `/usr/bin/env bash`, and whether a script really needed Bash in the first place.

时间线

  • 1980s: Bash is created as the GNU Project's Bourne-Again SHell, a free software shell in the Bourne shell lineage.
  • 1994: GNU FTP archive lists Bash 1.14-era release artifacts.
  • 1996: GNU FTP archive lists Bash 2.0.
  • 2004: GNU FTP archive lists Bash 3.0.
  • 2006: Bash 3.2 appears; this line later becomes important on macOS.
  • 2009: GNU FTP archive lists Bash 4.0.
  • 2019: GNU FTP archive lists Bash 5.0.
  • 2022: GNU FTP archive lists Bash 5.2.
  • 2025: GNU FTP archive lists Bash 5.3.
  • 2026: Chet Ramey's Bash page identifies Bash 5.3 as the current version and points to the Savannah Git repository for patched current sources.

Related projects

  • Directly related shells and standards include the Bourne shell, POSIX `sh`, ksh, csh, zsh, dash, and fish. Bash is also tightly connected to GNU Readline, GNU coreutils-era shell scripting, Autoconf-style configure scripts, ShellCheck, shfmt, and the large ecosystem of Bash completion packages.

来源

  • Official Bash information page describes Bash as the GNU Project's Bourne Again SHell, a POSIX/Open Group shell implementation with editing, job control, history substitution, brace expansion, GPL licensing, current version, repository, release archives, and distribution notes.
  • Official Bash manual documents the Bourne-Again SHell name, GNU shell role, invocation, startup files, `~/.bashrc`, login files, and `BASH_ENV`.
  • Official GNU FTP archive lists historical Bash release artifacts from 1.14, 2.0, 3.x, 4.x, 5.0, 5.1, 5.2, and 5.3.
  • input.source_facts.package-manager lists broad package-manager coverage across Linux distributions, BSD-adjacent package systems, Homebrew, MacPorts, and Nix.

安全态势

风险级别:yellow

doc example: shell runtime.

风险分类器

yellow 风险 · 高 置信度 · runtime

原因

  • doc example: shell runtime

信号

  • override:bash

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 6 个平台目标。
  • 安装时包含 3 个运行时依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

local files

Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.

Configuration files

Config paths the tool may read or write during local use.

Unix
~/.bashrc~/.bash_profile~/.bash_login~/.profile

Credential files

Credential-bearing paths to review before unattended agent runs.

Unix
~/.bashrc~/.bash_profile~/.bash_login~/.profile

可执行文件

已安装的可执行文件

命令类型暴露范围备注
bashcli全局可执行文件
bashbugcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-10
管理器版本5.3.15
管理器更新时间2026-06-11
本地数据OK
上游not checked
检测到的最新版本未检测到

https://www.gnu.org/software/bash/

安装元数据

软件包元数据

软件包键brew:bash
版本5.3.15
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/bash
主页https://www.gnu.org/software/bash/
仓库https://git.savannah.gnu.org/git/bash.git
上游文档https://www.gnu.org/software/bash
许可证GPL-3.0-or-later
源码归档https://ftpmirror.gnu.org/gnu/bash/bash-5.3.tar.gz
最后更新2026-06-11T00:44:57Z
Pulseupdated
依赖gettext, ncurses, readline
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明
注意事项DEFAULT_LOADABLE_BUILTINS_PATH: $HOMEBREW_PREFIX/lib/bash:/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:.

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namebash
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Debian apt95%

bash 5.2.37-2+b9

GNU Bourne Again SHell

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash
  • Section: shells
  • Architecture: amd64
  • Source Package: bash
  • 2 依赖
  • 2 可选依赖
  • normalized package name match
  • 匹配方式:Bash
Debian stable package indexes · deb.debian.org · Debian stable package indexes: bash from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

bash-builtins 5.2.37-2+b9

Bash loadable builtins - headers & examples

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash-builtins
  • Section: utils
  • Architecture: amd64
  • Source Package: bash
  • 1 依赖
  • normalized package name match
  • 匹配方式:Bash
Debian stable package indexes · deb.debian.org · Debian stable package indexes: bash-builtins from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

bash-doc 5.2.37-2

Documentation and examples for the GNU Bourne Again SHell

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash-doc
  • Section: doc
  • Architecture: all
  • Source Package: bash
  • normalized package name match
  • 匹配方式:Bash
Debian stable package indexes · deb.debian.org · Debian stable package indexes: bash-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

bash-static 5.2.37-2+b9

GNU Bourne Again SHell (static version)

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash-static
  • Section: shells
  • Architecture: amd64
  • Source Package: bash
  • 2 依赖
  • 1 可选依赖
  • normalized package name match
  • 匹配方式:Bash
Debian stable package indexes · deb.debian.org · Debian stable package indexes: bash-static from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

bash

nix profile install nixpkgs#bash
  • normalized package name match
  • 匹配方式:Bash
nixpkgs package indexes · raw.githubusercontent.com · nixpkgs package indexes: bash from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
Ubuntu apt95%

bash 5.2.21-2ubuntu4

GNU Bourne Again SHell

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash
  • Section: shells
  • Architecture: amd64
  • 2 依赖
  • 2 可选依赖
  • normalized package name match
  • 匹配方式:Bash
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: bash from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

bash-builtins 5.2.21-2ubuntu4

Bash loadable builtins - headers & examples

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash-builtins
  • Section: universe/utils
  • Architecture: amd64
  • Source Package: bash
  • 1 依赖
  • normalized package name match
  • 匹配方式:Bash
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: bash-builtins from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt95%

bash-doc 5.2.21-2ubuntu4

Documentation and examples for the GNU Bourne Again SHell

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash-doc
  • Section: doc
  • Architecture: all
  • Source Package: bash
  • normalized package name match
  • 匹配方式:Bash
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: bash-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

bash-static 5.2.21-2ubuntu4

GNU Bourne Again SHell (static version)

http://tiswww.case.edu/php/chet/bash/bashtop.html

sudo apt install bash-static
  • Section: universe/shells
  • Architecture: amd64
  • Source Package: bash
  • 2 依赖
  • 1 可选依赖
  • normalized package name match
  • 匹配方式:Bash
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: bash-static from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

bash 5.3.9-r1

The GNU Bourne Again shell

https://www.gnu.org/software/bash/bash.html

sudo apk add bash
  • License: GPL-3.0-or-later
  • Architecture: x86_64
  • Source Package: bash
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Bash
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: bash from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
apk95%

bash-dbg 5.3.9-r1

The GNU Bourne Again shell (debug symbols)

https://www.gnu.org/software/bash/bash.html

sudo apk add bash-dbg
  • License: GPL-3.0-or-later
  • Architecture: x86_64
  • Source Package: bash
  • 1 依赖
  • normalized package name match
  • 匹配方式:Bash
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: bash-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
apk95%

bash-dev 5.3.9-r1

The GNU Bourne Again shell (development files)

https://www.gnu.org/software/bash/bash.html

sudo apk add bash-dev
  • License: GPL-3.0-or-later
  • Architecture: x86_64
  • Source Package: bash
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Bash
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: bash-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
apk95%

bash-doc 5.3.9-r1

The GNU Bourne Again shell (documentation)

https://www.gnu.org/software/bash/bash.html

sudo apk add bash-doc
  • License: GPL-3.0-or-later
  • Architecture: x86_64
  • Source Package: bash
  • normalized package name match
  • 匹配方式:Bash
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: bash-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
dnf95%

bash 5.3.9-3.fc44

The GNU Bourne Again shell

https://www.gnu.org/software/bash

sudo dnf install bash
  • License: GPL-3.0-or-later
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: bash
  • 4 依赖
  • 4 提供
  • normalized package name match
  • 匹配方式:Bash
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: bash from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

bash-devel 5.3.9-3.fc44

Development headers for bash

https://www.gnu.org/software/bash

sudo dnf install bash-devel
  • License: GPL-3.0-or-later
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: bash
  • 2 依赖
  • 2 提供
  • normalized package name match
  • 匹配方式:Bash
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: bash-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

bash-doc 5.3.9-3.fc44

Documentation files for bash

https://www.gnu.org/software/bash

sudo dnf install bash-doc
  • License: GPL-3.0-or-later
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: bash
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Bash
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: bash-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

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