How to Install and Use Odin on Ubuntu 26.04 and 24.04

Share

To install Odin on Ubuntu 26.04 LTS or 24.04 LTS, use the official Linux archive and install Clang for linking. Odin is a compiled language used for systems software, tools, and games. A small terminal program lets you verify that the compiler and linker work together.

Before you begin
  • Open a Bash terminal on Ubuntu 26.04 LTS or 24.04 LTS. Official archives are available for 64-bit Intel and AMD PCs and 64-bit ARM systems.
  • You need internet access and sudo for Ubuntu packages. Install Odin and build your code as your regular user.

How to install Odin on Ubuntu

Step 1. Check your Ubuntu release

Check which release your terminal is running.

Ubuntu terminal
. /etc/os-release
printf '%s\n' "$PRETTY_NAME"

See how to check your Ubuntu version if you need to check from Settings.

Step 2. Check your CPU architecture
Ubuntu terminal
dpkg --print-architecture

Use the AMD64 archive if the result is amd64 and the ARM64 archive if it is arm64. The download block selects the file for you.

Step 3. Choose the official compiler release

On Ubuntu 24.04 LTS and Ubuntu 26.04 LTS, sudo apt install odin installs Odin 2.0.5, a medical magnetic resonance simulation package from Universe. For the programming language compiler, use the official dev-2026-11a release from the Odin project.

Step 4. Install Clang and the download tools

The prebuilt Odin compiler already includes LLVM for code generation. Odin calls Ubuntu’s clang during linking to produce native executables.

Ubuntu terminal
sudo apt update && sudo apt install -y clang curl tar ca-certificates
Step 5. Download, verify and extract Odin

The official assets are odin-linux-amd64-dev-2026-11a.tar.gz and odin-linux-arm64-dev-2026-11a.tar.gz. GitHub shows each SHA-256 digest in the release asset table. The block uses the matching digest directly. Look for the filename followed by OK. A checksum failure stops the block before extraction.

Ubuntu terminal
(
  set -eu
  set -o pipefail
  release=dev-2026-11a
  arch=$(dpkg --print-architecture)

  case "$arch" in
    amd64) sha=65c9f6e97d6f8a30930e151f270ce5aeaa98fe8b2ba49fe067394e2af04f7618 ;;
    arm64) sha=5bdba22447ea46a99765235e401c2ad83930f967f987aab1531ed76c3aa7ea3b ;;
    *) printf 'No Linux archive for %s\n' "$arch" >&2; exit 1 ;;
  esac

  archive="odin-linux-$arch-$release.tar.gz"
  install_dir="$HOME/.local/opt/odin"
  mkdir -p "$install_dir"
  work=$(mktemp -d "$install_dir/.download.XXXXXXXX")
  trap 'rm -rf -- "$work"' EXIT
  cd "$work"

  curl -fL --retry 3 -O \
    "https://github.com/odin-lang/Odin/releases/download/$release/$archive"
  echo "$sha  $archive" | sha256sum -c -

  mkdir extracted
  tar --strip-components=1 -xzf "$archive" -C extracted
  test -x extracted/odin
  test -d extracted/base
  test -d extracted/core
  test -d extracted/vendor
  mv -T --no-clobber -- extracted "$install_dir/$release"
  if test -d extracted; then
    printf 'Release directory already exists. Check the installed copy first.\n' >&2
    exit 1
  fi
)

The temporary download is cleaned up when the block exits. The verified compiler and its libraries go into ~/.local/opt/odin/dev-2026-11a.

Step 6. Add Odin to PATH and verify the install

For a fresh install, point the current symlink at this release. If that symlink already exists, use the update steps below.

Ubuntu terminal
ln -sT dev-2026-11a "$HOME/.local/opt/odin/current"

Add the linked directory to PATH in ~/.bashrc. Then check the compiler version and library root.

Ubuntu terminal
odin_path_line='export PATH="$HOME/.local/opt/odin/current:$PATH"'
if ! grep -Fqx -- "$odin_path_line" "$HOME/.bashrc" 2>/dev/null; then
  printf '\n%s\n' "$odin_path_line" >> "$HOME/.bashrc"
fi
source "$HOME/.bashrc"
hash -r
odin version
odin root

The version should include dev-2026-11. The compiler can report a build suffix instead of the GitHub release tag. The root should resolve to the toolchain folder from Step 5. Keep the executable with base/, core/ and vendor/. If you move the executable by itself, set ODIN_ROOT to the directory with the matching libraries.

If you use mise on Ubuntu, you can also manage Odin versions with it once Clang is installed.

Run and build your first Odin program

Step 7. Create and run a project

Create a clean hello_odin directory under your home folder. If that directory already exists, pick a different name. The program uses the built-in core:fmt package to print a greeting.

Ubuntu terminal
mkdir "$HOME/hello_odin" && cd "$HOME/hello_odin" && cat > main.odin <<'ODIN'
package main

import "core:fmt"

main :: proc() {
    fmt.println("Hello from Odin on Ubuntu!")
}
ODIN

From that directory, compile and run the project. The dot selects the package in the current directory.

Ubuntu terminal
odin run .

Expected output Hello from Odin on Ubuntu!

Step 8. Build and run the native executable

Use odin build . to compile the program without running it. The -out:hello_odin option sets the output filename. In this fresh project directory, build it and then run the file directly.

Ubuntu terminal
odin build . -out:hello_odin && ./hello_odin

The same greeting confirms the native executable linked and ran.

Fix common Odin installation problems

Problem 1. Bash finds the wrong Odin

Use type -a odin to see which command Bash finds first. Check the PATH line in ~/.bashrc, then open a new Bash terminal. If there is an alias or a different version manager active, check its configuration too.

Problem 2. Odin cannot find its libraries

Run odin root and check that the directory contains the libraries from the same release as the executable. Restore the archive layout if you moved the binary. If your shell sets an outdated ODIN_ROOT, remove or correct that setting before opening a new terminal.

Problem 3. The linker fails

Check that clang --version runs. If the linker reports missing C startup files or -lc, install the Ubuntu build tools and try the build again from the project folder.

Ubuntu terminal
sudo apt install -y build-essential

Update or remove Odin

Update Odin and keep the previous release

Use the latest official release to repeat Step 5 with the new tag and the two published Linux digests. If the asset names change, update the archive filename pattern as well. Extract the release first, then replace NEW-TAG below with the new directory name and switch the symlink.

Ubuntu terminal
new_tag="NEW-TAG"
odin_dir="$HOME/.local/opt/odin"
test -x "$odin_dir/$new_tag/odin" &&
  ln -sfnT "$new_tag" "$odin_dir/current" &&
  hash -r && odin version && odin root

Rebuild a project before removing the old release. To roll back, switch current back to the previous directory.

Remove Odin without deleting your projects

Remove the Odin PATH line from ~/.bashrc. Then remove the symlink and the extracted release directory. The commands ask you to confirm removal. If you installed other releases, check and remove them by their exact directory names. Project folders such as ~/hello_odin are separate.

Ubuntu terminal
rm -i -- "$HOME/.local/opt/odin/current"
rm -rI -- "$HOME/.local/opt/odin/dev-2026-11a"

Open a new Bash terminal to refresh PATH. Leave Clang installed if you use it for other projects.

Odin FAQ

Do I need to install LLVM separately?

The prebuilt Odin compiler includes LLVM for code generation. Install Clang so Odin can link native executables.

Can I keep more than one Odin release?

Yes. Keep each release in its own directory with its bundled libraries, and point the current symlink at the release you want to use.

Helpful Resources

Odin on Reddit Ask questions and see community projects
Odin language overview Learn syntax and how packages work
Odin on GitHub Browse the source and report issues
Odin forum Get help with compiler and library questions

Source Official Odin installation guide.