⚠️ 此仓库由一个人在业余时间独立维护,没有任何资金、团队或外部支持

每个软件包和更新均免费构建和发布。如果这些软件包为您节省了时间,欢迎考虑支持该项目。

Buy me a coffee

🇿 安装最新的 Zig 在 Debian 上

获取最新的 Zig programming language packages

Latest Version: 0.15.2 (Released March 2025)
← 返回首页

什么是 Zig?

Zig is a general-purpose programming language and toolchain designed for maintaining robust, optimal, and reusable software. Created by Andrew Kelley, Zig aims to be a better alternative to C, offering modern language features while maintaining the simplicity and performance that systems programmers need.

🚀 Why Latest Versions Matter: Zig is rapidly evolving with significant performance improvements, new language features, and critical bug fixes in each release. The latest 0.15.2 includes major enhancements like improved cross-compilation, faster compilation times, and enhanced debugging capabilities.

🔥 Key Features of Zig

⚡ Simple & Fast

No hidden control flow, no hidden memory allocations, no preprocessor. Focus on debugging your application, not your language knowledge.

🔧 Comptime Magic

Compile-time code execution and lazy evaluation. Call any function at compile-time and manipulate types as values without runtime overhead.

🌐 Cross-Compilation

Built-in cross-compilation support for dozens of targets. No external dependencies needed for most platforms.

🔄 C/C++ Interop

Use Zig as a drop-in C/C++ compiler with better cross-compilation. Incrementally adopt Zig in existing codebases.

🆕 Zig 0.16.0 新特性

📦 从 debian.griffo.io 安装

步骤 1:添加仓库

curl -sS https://debian.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/debian.griffo.io.gpg echo "deb https://debian.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/debian.griffo.io.list sudo apt update
curl -sS https://debian.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/debian.griffo.io.gpg echo "deb https://debian.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | tee /etc/apt/sources.list.d/debian.griffo.io.list apt update
⚠️ Breaking Change — New Package Structure

This repository uses reprepro, which is configured to keep only the latest version of each package. This means older builds are replaced when a new release ships — you cannot pin a specific version with apt install zig=0.15.2 after 0.16.0 has been published.

To let users keep a previous release installed alongside the current one, packages are now named by stability tier:
  • zig — meta-package, always pulls in zig-stable
  • zig-stable — current stable release (e.g. 0.16.0)
  • zig-oldstable — previous stable release (e.g. 0.15.2), installable alongside zig-stable
  • zig-0deprecated, install zig-stable instead
zig-stable and zig-oldstable register with update-alternatives so you can switch the active /usr/bin/zig at any time.

⬆️ 升级到 0.16.0:如果您已安装旧包结构中的 zig-0,必须先将其删除:
apt update && apt remove zig zig-0 && apt install zig
如需同时安装上一个稳定版本(0.15.2):
apt install zig-oldstable

步骤 2:安装 Zig

# Install current stable Zig sudo apt install zig # Optionally install the previous stable release alongside it sudo apt install zig-oldstable # Switch between installed versions at any time sudo update-alternatives --config zig # Or install nightly builds for cutting-edge features sudo apt install zig-master
# Install current stable Zig apt install zig # Optionally install the previous stable release alongside it apt install zig-oldstable # Switch between installed versions at any time update-alternatives --config zig # Or install nightly builds for cutting-edge features apt install zig-master

🎯 基本使用示例

Create a new project:

# Create and enter project directory mkdir my-zig-project && cd my-zig-project # Initialize new Zig project zig init # Build and run zig build run

Compile a single file:

# Create hello.zig echo 'const std = @import("std"); pub fn main() void { std.debug.print("Hello, Zig!\n", .{}); }' > hello.zig # Compile and run zig run hello.zig

Use as C compiler:

# Compile C code with Zig zig cc -o program program.c # Cross-compile for different targets zig cc -target x86_64-windows -o program.exe program.c

🚀 为什么选择 debian.griffo.io?

⚠️ Official Debian Lag: Official Debian repositories often contain outdated Zig versions that may be months or even years behind the latest release, missing critical features and performance improvements.

📦 软件包构建仓库

Debian 软件包在这些 GitHub 仓库中自动构建和维护:

🔗 相关软件包

也可从 debian.griffo.io 获取:

🎯 Perfect for: Systems programming, game development, embedded systems, performance-critical applications, and anyone wanting a modern alternative to C with better safety and tooling.