avatarRajdeep Singh

Summary

The provided web content details the installation process of Bun, a stable and production-ready JavaScript runtime and toolkit, on Debian and other Linux distributions, along with its uninstallation and update procedures.

Abstract

The article "How to install Bun in Debian & Linux distro?" published on September 8, 2023, announces the release of Bun 1.0, marking its readiness for production use. Bun is described as an all-in-one JavaScript runtime and toolkit, offering various installation methods for Linux users, including using Curl and Node Package Manager (NPM). The primary method recommended is via Curl, which involves running a script from the official Bun website. The installation requires two prerequisite tools: Unzip and Curl. The article also provides instructions for installing specific versions of Bun, handling potential errors, and using NPM for installation. Additionally, it covers how to update Bun and uninstall it, depending on the installation method used. The conclusion suggests that Bun is a significant new tool in the JavaScript ecosystem, potentially serving as an alternative to Node.js, and invites readers to follow the author on social media for more related content.

Opinions

  • The author emphasizes the stability and production readiness of Bun 1.0.
  • Installing Bun with Curl is presented as the most common method.
  • The author suggests that Unzip and Curl are essential tools for installing Bun.
  • The article highlights the ease of installing a specific version of Bun if needed.
  • An error message regarding the lack of Unzip is specifically mentioned, indicating its importance in the installation process.
  • The author notes that Bun can be installed with NPM, but not with Yarn or PNPM.
  • The article provides a straightforward command to update Bun, regardless of the initial installation method.
  • The uninstallation process is clearly delineated based on the installation method used.
  • The author expresses enthusiasm about Bun's potential, comparing it to Deno and suggesting it as an alternative to Node.js.
  • The author encourages community engagement and sharing of information by inviting readers to follow their work on various platforms.
Photo by Bun team

Linux

How to install Bun in Debian & Linux distro?

Install the Bun all-in-one JavaScript runtime & toolkit in the Linux distro.

On September 8, 2023, Bun 1.0 was rolled out, and now Bun is stable and ready for production.

You can install Bun locally in your system in various ways. You can install Bun with curl in your Linux distro and use the node package manager (NPM, yarn, and PNPM).

The most common way to install a bun is with a Curl script, but we discuss every possible way so that you can install a bun very easily in your Linux distro.

Requirement

Before installing the Bun, You need to install two command line tools or software.

Please skip this section if both software are already installed in your system.

  1. Unzip
  2. Curl

Unzip

Unzip is required to install the Bun in Linux or Linux distro. It means without Unzip, you can not install the Bun.

You can install the unzip with the following command.

sudo apt-get install unzip

Run the following command to verify whether the unzip is installed in your system.

unzip -v

Curl

If the curl command is not installed in your system, then first install the curl command with the following command.

sudo apt-get install curl

Run the following command to verify whether the curl is installed in your system.

curl -v

Installation

  1. Curl
  2. Node Package Manager

Curl

You can install Bun with a curl command. Paste the following command in your terminal. It is installed with the latest version of Bun.

curl -fsSL https://bun.sh/install | bash

Command output looks like this.

$ curl -fsSL https://bun.sh/install | bash 
######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun 

Added "~/.bun/bin" to $PATH in "~/.bashrc" 

To get started, run: 

  source /home/gitpod/.bashrc 
  bun --help

You can also install a Specific version of Bun with the following command.

# to install a specific version
curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"

Command output looks like this.

$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"
######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun 
Run 'bun --help' to get started

Error Unzip is required

if you find an error, unzip is required to install the bun. in that case, install unzip with the following command and rerun your bun installation command.

sudo apt-get install unzip

Node Package Manager

The second way is to install Bun using the node package manager. To install the Bun, run the following command.

The following command installs the latest version of Bun in your system.

npm install -g bun

Command output looks like this.

$ npm uninstall -g bun

removed 3 packages in 254ms

Install the specified version of the Bun with the NPM command.

 npm install -g bun@1.0.0

## Note

You can not install a bun with yarn and pnpm.

How do I update Bun?

Even if you use NPM or curl command to install the Bun, you just run the following command to update the Bun.

$ bun upgrade

Command output looks like this.

$ bun upgrade
bun v1.0.2 is out! You're on 1.0.0
[2.05s] Upgraded.

Welcome to bun v1.0.2!

Report any bugs:

    https://github.com/oven-sh/bun/issues

What's new:

    https://github.com/oven-sh/bun/releases/tag/bun-v1.0.2

Changelog:

    https://github.com/oven-sh/bun/compare/bun-v1.0.0...bun-v1.0.2

How do you remove the Bun in the Linux distro?

To remove or uninstall the Bun. It depends on the bun installation. For example, if you use NPM, you need a different command, or if you use the curl command, you need another one.

Based on installation, you require a different command to uninstall Bun.

  1. With curl
  2. NPM

With curl

If you install Bun with the curl command. To uninstall the Bun, run the following command.

sudo rm -rf ~/.bun

NPM

If you use NPM to install Bun, run the following command: uninstall Bun.

npm uninstall -g  bun

Conclusion

Bun's all-in-one JavaScript runtime & toolkit launch with vital revolution feature. Similar to Deno.

Everything depends on community adoption, and now Bun is an excellent alternative to Node.js.

You can share and follow me on Twitter and LinkedIn. I write tons of articles related to frontend development and Linux.

If you are interested in those topics, follow me on Medium, officialrajdeepsingh.dev, join the Linux and frontend web publication, and sign up for my free newsletter.

Bűn
Bun Runtime
Install Bun
Install Bun In Linux
Bun Javascript Runtime
Recommended from ReadMedium