How to install Zephyr 26.04 LTS on your host system¶
This guide explains how to install Zephyr 26.04 LTS on your Ubuntu host without the Workshop development environment. It follows the upstream Zephyr installation model but installs west and its Python requirements from Ubuntu packages instead of pip and a Python virtual environment.
Workshop is the supported standard path. With a host system installation, you must maintain each host dependency.
Prerequisites¶
Before starting, ensure you have these requirements satisfied:
A host running Ubuntu 26.04 (the supported host release).
Access to the internet.
Permission to use sudo on the host.
Install host packages and the Package Index¶
To provide LTS guarantees, we encourage users to install west, the
Zephyr toolchains and Python dependencies through the Zephyr 26.04 LTS Personal
Package Archive (PPA): ppa:arctic-tern/zephyr-toolchain-26.04.
Note
sudo add-apt-repository installs the packages globally. You can install them in a Docker or LXD container. This guide works in a container as well.
Add the packages:
$ sudo add-apt-repository ppa:arctic-tern/zephyr-toolchain-26.04
Update the package index:
$ sudo apt update
Install the build packages:
$ sudo apt install --no-install-recommends \
git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \
xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
Create the west workspace¶
Install west:
$ sudo apt install west
Initialize the workspace from the 26.04.0 source tag in Canonical’s Zephyr manifest repository:
$ west init -m https://git.launchpad.net/~arctic-tern/zephyr-rtos/+git/zephyr-manifest \
--mr 26.04.0 ~/zephyrproject
$ cd ~/zephyrproject
Download shallow copies of the pinned repositories:
$ west update --narrow -o=--depth=1
Install the Python packages that the Zephyr source tree requires:
$ sudo apt install --no-install-recommends \
python3-yaml python3-pykwalify python3-canopen python3-packaging \
python3-progress python3-psutil python3-pylink-square python3-serial \
python3-requests python3-anytree python3-intelhex python3-pyelftools
Note
The upstream pip model (pip install -r requirements.txt) is a
known issue in 26.04. It builds C extensions such as ruamel-yaml-clib
from source, which requires python3-dev, a package that is not
preinstalled on a clean Ubuntu 26.04 image. Install python3-dev or use
the package install shown above.
Export the Zephyr CMake package:
$ west zephyr-export
Install the Zephyr 26.04 LTS SDK¶
The sdk-ng repository contains the LTS version of the Zephyr 4.4 SDK.
First, ensure that SDK version listed in zephyr/SDK_VERSION match
1.0.1:
$ cat zephyr/SDK_VERSION
1.0.1
Install the common SDK files. This will register the CMake package and export
ZEPHYR_SDK_INSTALL_DIR:
$ sudo apt install rtos-zephyr-sdk-ng-common
Install the toolchain package for your target architecture. The Hello World
sample in this guide targets qemu_x86, which requires the
x86_64-zephyr-elf toolchain:
$ sudo apt install rtos-zephyr-sdk-x86-64-zephyr-elf
Note
If you are targeting a different board, search the PPA for its toolchain package:
$ apt search rtos-zephyr-sdk-
Note
To install every toolchain instead,
use the rtos-zephyr-sdk-ng metapackage:
$ sudo apt install rtos-zephyr-sdk-ng
Start a new shell, or source the profile script directly, so
ZEPHYR_SDK_INSTALL_DIR takes effect:
$ source /etc/profile.d/zephyr-sdk-ng.sh
West reads ZEPHYR_SDK_INSTALL_DIR to find the SDK.
Note
The SDK toolchain packages do not include OpenOCD or its udev rules, unlike the upstream tarball. To flash real hardware, install OpenOCD from the Ubuntu archive that provides the required udev rules:
$ sudo apt install openocd
Build Hello World¶
Now build the Hello World sample:
$ cd ~/zephyrproject/zephyr
$ west build -p always -b qemu_x86 samples/hello_world
And run the sample in QEMU:
$ west build -t run
Press Ctrl+A, then press X to stop QEMU.
See also¶
Tutorial:
Explanation:
Reference: