53 个开发者工具,始终保持最新 — 上游每次发布后数小时内即可通过 apt 获取。 加入 Discord

📅 自 起,使用本 apt 镜像将需要订阅。 查看价格 · 🆓 有一个永久免费的镜像

🥟 安装最新的 Bun 在 Ubuntu 上

最新版本:1.4.0 · 更新于 2026-08-20
来源版本
deb.griffo.io1.4.0 ✅
官方 Ubuntu🚫 未收录

快速的一体化 JavaScript 运行时,具有打包器、测试运行器和包管理器

← 返回首页

什么是 Bun?

Bun is a fast all-in-one JavaScript runtime built from scratch to serve the modern JavaScript ecosystem. It's designed as a drop-in replacement for Node.js with significantly better performance, featuring a built-in bundler, test runner, and package manager all in a single executable.

🚀 Why Latest Versions Matter: Bun is rapidly evolving with major performance improvements, new JavaScript/TypeScript features, and enhanced compatibility in each release. The latest versions include critical bug fixes, improved Node.js compatibility, and significant speed improvements for package management and bundling.

🔥 Key Features of Bun

⚡ Blazing Fast

Up to 4x faster than Node.js for many workloads, with optimized JavaScript engine and native code compilation.

📦 Built-in Package Manager

Install packages up to 25x faster than npm with built-in package management and lockfile compatibility.

🛠️ Bundler Included

Native bundler with tree-shaking, code splitting, and hot reloading - no webpack or rollup needed.

🧪 Test Runner

Built-in test runner compatible with Jest API, with parallel execution and watch mode.

🔄 Node.js Compatible

Drop-in replacement for Node.js with excellent compatibility for existing npm packages and APIs.

📝 TypeScript Native

Run TypeScript files directly without compilation step, with built-in transpilation.

📦 从 deb.griffo.io 安装

运行命令

步骤 1:添加仓库

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
sudo apt update
install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
apt update

🆓 有一个永久免费的镜像。 deb-free.griffo.io 永久免费提供软件包 — 无需账号、无需订阅,最多落后上游 2 个月,安全修复立即发布。目前收录 cliamp、Ghostty、lazydocker、Oh My Posh 和 Zed;Bun 不在其中,因此今天只能通过上面的仓库安装 — 提出请求即可将其加入。

免费镜像的工作方式 →

📋 Available Bun Packages

deb.griffo.io provides three different Bun packages to suit different needs:

🥟 bun (Recommended)

Metapackage that automatically installs the latest stable bun-one. This is the recommended choice for most users as it ensures you always get the latest stable release.

sudo apt install bun
apt install bun
🚀 bun-one

Latest stable release of Bun runtime. This package contains the production-ready version with optimizations for performance and stability.

sudo apt install bun-one
apt install bun-one
🔍 bun-profile

Profiling-enabled build of Bun with debugging symbols and profiling capabilities. Ideal for development, debugging, and performance analysis. Slightly larger binary with additional debugging information.

sudo apt install bun-profile
apt install bun-profile

🔄 Managing Multiple Bun Versions

You can install both bun-one and bun-profile simultaneously and switch between them using Debian's update-alternatives system:

Install both versions:

sudo apt install bun-one bun-profile
apt install bun-one bun-profile

Configure alternatives (done automatically during package installation):

sudo update-alternatives --install /usr/bin/bun bun /usr/bin/bun-one 100
sudo update-alternatives --install /usr/bin/bun bun /usr/bin/bun-profile 90
update-alternatives --install /usr/bin/bun bun /usr/bin/bun-one 100
update-alternatives --install /usr/bin/bun bun /usr/bin/bun-profile 90

Switch between versions interactively:

sudo update-alternatives --config bun
update-alternatives --config bun

Check current version:

bun --version
which bun

步骤 2:安装 Bun

sudo apt install bun
apt install bun

Step 3: Verify Installation

bun --version
bun --help

🚀 Quick Start Examples

Create a new project:

mkdir my-bun-app && cd my-bun-app
bun init

Install packages (faster than npm):

bun install express
bun add -d @types/express

Run TypeScript directly:

echo 'console.log("Hello from Bun!")' > app.ts
bun run app.ts

Bundle for production:

bun build ./app.ts --outdir ./dist --minify

Run tests:

bun test

🔧 Configuration

Bun can be configured using a bunfig.toml file in your project root or home directory:

# bunfig.toml
[install]
# Configure package manager behavior
cache = "~/.bun/install/cache"
registry = "https://registry.npmjs.org"

[run]
# Configure script runner
shell = "bash"

[test]
# Configure test runner
preload = ["./setup.ts"]

⚡ Performance Benefits

📦 Package Installation

Up to 25x faster than npm, 4x faster than pnpm for installing dependencies.

🏃 Runtime Performance

4x faster than Node.js for many JavaScript workloads with optimized engine.

🛠️ Bundling Speed

Native bundler significantly faster than webpack, rollup, or esbuild.

🧪 Test Execution

Parallel test execution with built-in runner, faster than Jest or Vitest.

📦 Package Build Repository

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

🔗 Related Packages

Enhance your development workflow with these complementary tools from deb.griffo.io:

📚 Additional Resources

📦 本仓库最近发布

❓ 常见问题

Bun 在官方 Ubuntu 软件源中吗?

不在, 官方 Ubuntu 源没有打包 Bun。本仓库目前是唯一的 apt 来源,提供 Bun 1.4.0。

如何在 Ubuntu 上安装最新版 Bun?

按上方说明一次性添加 deb.griffo.io 仓库,然后运行:sudo apt install bun。之后通过常规的 sudo apt upgrade 获取新版本。

软件包是否有签名?如何构建?

每个软件包都使用仓库的 GPG 密钥(EA0F721D231FDD3A0A17B9AC7808B4DD62C41256)签名,并基于上游发布在公开的 GitHub 仓库中构建,任何人都可以审查。

支持哪些 Ubuntu 版本?

Ubuntu 22.04 Jammy、24.04 Noble、25.10 Questing 和 26.04 Resolute。