DEV Community

Brent Vanwildemeersch
Brent Vanwildemeersch

Posted on

1

Bun command not found on Linux

After a clean install of bun on Linux, the bun command will not be recognised by the commandline, because bun was not automatically added to PATH

It will probably return a message as following,

bun --version

Command 'bun' not found, did you mean:

  command 'ben' from deb ben (0.9.0ubuntu2)
  command 'bus' from deb atm-tools (1:2.5.1-4)
  command 'zun' from deb python3-zunclient (4.0.0-0ubuntu1)

Try: sudo apt install <deb name>
Enter fullscreen mode Exit fullscreen mode

You can solve this with the following actions :

1. Edit the .bashrc file

nano nano ~/.bashrc 
Enter fullscreen mode Exit fullscreen mode

2. Add the following lines at the end of your .bashrc file

BUN_INSTALL="/home/{USERNAME}/.bun"
PATH="$BUN_INSTALL/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

with {USERNAME} replaced by your username.

3. Close your terminal and open a new shell

bun --version
Enter fullscreen mode Exit fullscreen mode

should now return information on the installed version of bun

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay