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

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

## 安装

```sh
sudo av install brew:gnucobol
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gnucobol
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gnucobol
```

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

### Linux

- apk (92%):

```sh
sudo apk add gnucobol
```

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

- Debian apt (92%):

```sh
sudo apt install gnucobol
```

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

- dnf (92%):

```sh
sudo dnf install gnucobol
```

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

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

- zypper (92%):

```sh
sudo zypper install gnucobol
```

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

## 软件包事实

- **软件包键:** brew:gnucobol
- **软件包管理器:** Homebrew
- **版本:** 3.2
- **来源摘要:** COBOL85-202x compiler supporting lots of dialect specific extensions
- **主页:** <https://gnucobol.sourceforge.io/>
- **最后更新:** 2026-06-28T03:24:27Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cob-config (别名)
- cobc (别名)
- cobcrun (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

GnuCOBOL is a free COBOL compiler that translates COBOL source to C and then uses the configured C compiler to produce native code. Its importance comes from keeping COBOL available in the GNU toolchain and package-manager world while supporting many historical dialects and newer COBOL standards features.

### 项目历史

The project began as OpenCOBOL around 2002. The FAQ credits Keisuke Nishida as the initial developer, influenced by TinyCOBOL, records the first public 0.9.0 release on January 25, 2002, and notes Roger While taking the lead developer role in 2004. OpenCOBOL 1.0 followed in 2007, and the 1.1 line became the basis for the GNU-era package.

OpenCOBOL was accepted as an official GNU project on September 27, 2013 and first rebranded as GNU Cobol. The spelling GnuCOBOL became preferred in September 2014, Simon Sobisch became project lead in 2014, and the FAQ records Free Software Foundation copyright assignment becoming legally binding in June 2015 for the source tree dating back to the original public release.

Later releases expanded dialect handling, diagnostics, runtime behavior, source-level debugging, report writer support, JSON and XML generation, and compatibility with older and vendor-specific COBOL styles. The project page describes GnuCOBOL 3.2 as producing native executables and supporting Linux, BSD, proprietary Unix systems, macOS, Windows, and other platforms.

### 采用历史

GnuCOBOL serves a particular adoption niche: organizations and individual programmers with COBOL code can compile and test it with a free compiler, often on commodity Unix-like systems. The FAQ says OpenCOBOL and GnuCOBOL have been used in production environments, while also warning that each production use needs risk analysis.

Its package-manager significance is amplified by COBOL's long commercial history. GnuCOBOL lets package repositories ship a working COBOL compiler without tying users to proprietary mainframe or vendor compiler ecosystems, and its LGPL runtime allows commercial use of generated programs under the stated license terms.

### 使用方式

Practitioners use cobc to compile COBOL files into modules, object files, C output, or executable programs. Typical workflows include building legacy COBOL with dialect options such as -std, compiling free-format or fixed-format source, integrating C libraries, running modules with cobcrun, and using compiler listings or warning modes during modernization.

The package is also used for teaching, migration experiments, CI checks for COBOL code, and prototyping around vendor dialects. Because GnuCOBOL emits C, users can lean on the host compiler, linker, debugger, and platform libraries rather than requiring a dedicated COBOL runtime environment for every step.

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

GnuCOBOL is the rare package that makes a historically enterprise language feel like a normal open-source compiler dependency. For package maintainers it is a bridge between COBOL archives and modern Unix build systems; for language-runtime collectors it is a compact way to keep COBOL executable on laptops, CI runners, and free-software distributions.

### 时间线

- 2002: OpenCOBOL 0.9.0 was publicly released.
- 2004: Roger While took the lead developer role.
- 2013: OpenCOBOL was accepted as an official GNU project and rebranded as GNU Cobol.
- 2014: GnuCOBOL became the preferred spelling and Simon Sobisch became project lead.
- 2015: FSF copyright assignment for the source tree became legally binding.
- 2023: GnuCOBOL 3.2 was released.

### Related projects

- Related projects include TinyCOBOL, the COBOL 85/2002/2014 standards, GCC or another configured C compiler, libcob, GDB, OpenCOBOLIDE, and vendor dialects such as IBM, Micro Focus, ACUCOBOL-GT, RM/COBOL, and GCOS.

### 来源

- <https://ftp.gnu.org/gnu/gnucobol/>
- <https://gnucobol.sourceforge.io/>
- <https://gnucobol.sourceforge.io/doc/gnucobol.html>
- <https://gnucobol.sourceforge.io/faq/>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - gnucobol - 5: normalized package name match | Debian stable package indexes: gnucobol from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | compiler package for default GnuCOBOL
- Nix - gnucobol: normalized package name match | nixpkgs package indexes: pkgs/by-name/gn/gnucobol/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - gnucobol - 5: normalized package name match | Ubuntu 24.04 LTS package indexes: gnucobol from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | compiler package for default GnuCOBOL
- apk - gnucobol - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: gnucobol from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | GnuCOBOL compiler | https://www.gnu.org/software/gnucobol/
- apk - gnucobol-doc - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: gnucobol-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | GnuCOBOL compiler (documentation) | https://www.gnu.org/software/gnucobol/
- apk - gnucobol-lang - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: gnucobol-lang from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Languages for package gnucobol | https://www.gnu.org/software/gnucobol/
- apk - libcob4 - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: libcob4 from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | GnuCOBOL runtime library | https://www.gnu.org/software/gnucobol/
- dnf - gnucobol - 3.2-10.fc45: normalized package name match | Fedora Rawhide package metadata: gnucobol from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | COBOL compiler | https://www.gnu.org/software/gnucobol/
- dnf - gnucobol-esql - 3.2-10.fc45: normalized package name match | Fedora Rawhide package metadata: gnucobol-esql from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | ESQL for GnuCOBOL | https://www.gnu.org/software/gnucobol/
- dnf - libcob - 3.2-10.fc45: normalized package name match | Fedora Rawhide package metadata: libcob from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | GnuCOBOL runtime library | https://www.gnu.org/software/gnucobol/
- zypper - gnucobol - 3.2-4.2: normalized package name match | openSUSE Tumbleweed package metadata: gnucobol from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A COBOL compiler | https://www.gnu.org/software/gnucobol/
- zypper - gnucobol-esql - 3.2-4.2: normalized package name match | openSUSE Tumbleweed package metadata: gnucobol-esql from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | ESQL for GnuCOBOL | https://www.gnu.org/software/gnucobol/
- zypper - gnucobol-esql-devel - 3.2-4.2: normalized package name match | openSUSE Tumbleweed package metadata: gnucobol-esql-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Devel package for ESQL | https://www.gnu.org/software/gnucobol/
- zypper - libcob4 - 3.2-4.2: normalized package name match | openSUSE Tumbleweed package metadata: libcob4 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | GnuCOBOL shared library | https://www.gnu.org/software/gnucobol/
- MacPorts - gnucobol: normalized package name match | MacPorts ports tree: lang/gnucobol/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/gnucobol.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gnucobol.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
