주황색 상자와 녹색 상자가 한 선반 위에 나란히 놓여 있고, 각 상자 안의 구슬 노드는 같은 상자끼리만 실선으로 이어지며 두 상자 사이를 건너는 연결선은 끊기거나 점선으로 흐려지는 개념 일러스트

Multiple ROS 2 Distros on One Machine: Humble, Jazzy, Kilted

한국어로 읽기

What happened when we ran it

The usual setup goes like this. Your Ubuntu machine already runs ROS 2 Jazzy, you want to try a second distro on it, and your ~/.bashrc ends up with two source lines, or with an export RMW_IMPLEMENTATION=... line copied from a tutorial. We recreated the parts of that setup that can be tested on a machine that only has Jazzy.

We started a clean bash inside a ros:jazzy-ros-base container, sourced /opt/ros/jazzy/setup.bash, and then sourced /opt/ros/kilted/setup.bash, which was not installed. You get the same thing from a .bashrc line left over after you remove a distro, or one added before you installed it. In every run the second source printed No such file or directory and failed. The shell still opened normally, bash reported success, and ROS_DISTRO was still jazzy. Nothing in that terminal showed that you were not on the distro you meant to use.

Next we pointed RMW_IMPLEMENTATION at rmw_cyclonedds_cpp, which was not installed either. The Python process stopped at import rclpy. It printed one [rcl] error line to stderr and exited with an error code. Python never raised an exception, so a try/except around node creation would not catch it. As a control, a publisher and a subscriber that used the same distro and the same RMW received every message we sent.

What we did not do: we never installed two distros. We never ran a Humble node against a Jazzy node, and we never ran two RMW vendors against each other. The container only has Jazzy and Fast DDS. Those questions are answered below from the official ROS 2 documentation, plus a check you can run on your own machine. They are not measurements.

The short answer:

  • Installing two distros side by side works only if apt has packages for both on your Ubuntu codename. On Ubuntu 24.04 (Noble), Jazzy, Kilted and Rolling are available as debs. Humble (22.04) and Lyrical (26.04) are not. Before you install, run apt-get install -s and look for Remv lines.
  • Sourcing: one distro per terminal. Do not chain source lines in .bashrc, and check echo $ROS_DISTRO in each new terminal.
  • Mixing nodes is not supported by the ROS 2 docs. That covers nodes from different distros, and also nodes from the same distro that use different RMW vendors. It may work, but you should not rely on it.

Environment

  • Image: ros:jazzy-ros-base, pinned as ros@sha256:00b8d47a6e6384a2834e3d01fa87ae767876543baa574f2d64a75c04ea33c698
  • ROS distro: jazzy. Python 3.12.3, rclpy 7.1.12-1noble.20260912.162354
  • RMW: rmw_fastrtps_cpp (default)
  • No network, 1 CPU, 1 GiB memory
  • The same script (script_sha256 0eb83abe0a24c67c58f0c73d69ef19ca22ffcaefcd14122d5b67a8629d1921ab) ran 5 times. All 5 exited with code 0 and took 7.45–7.55 s each.
  • Inventory, identical in all 5 runs: /opt/ros contained only jazzy. The only RMW implementation library was librmw_fastrtps_cpp.so, and the ament index listed 194 packages.

Each shell state was measured in a new bash started with env -i HOME=/tmp PATH=<default path> bash --noprofile --norc -c. That removes whatever the container had already sourced. kilted only stands for a distro whose setup file does not exist. It is not a real Kilted install.

Predictions vs. results

Case Prediction (plan.md, before running) Result, 5 of 5 runs
No source No ROS variables ROS_DISTRO unset, 0 ROS_/AMENT_ variables, ros2 not on PATH
Jazzy sourced once ROS_DISTRO=jazzy jazzy. AMENT_PREFIX_PATH 1 entry, 1 /opt/ros entry in PATH, 1 in PYTHONPATH, 2 in LD_LIBRARY_PATH, 5 ROS_/AMENT_ variables
Jazzy sourced twice ROS_DISTRO=jazzy; duplicate path entries unknown jazzy, with the same counts as sourcing once (1 / 1 / 1 / 2 / 5). No duplicate entries.
Only the missing kilted setup sourced source fails with a non-zero exit source exit 1, No such file or directory, 0 ROS variables, bash exit 0
Jazzy, then the missing kilted setup Second source fails; ROS_DISTRO stays jazzy Source exit codes [0, 1], ROS_DISTRO=jazzy, bash exit 0, ros2 still on PATH
RMW_IMPLEMENTATION unset, or rmw_fastrtps_cpp Control (no prediction) Reached import → init → create_node, exit 0, identifier rmw_fastrtps_cpp
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp (not installed) Fails; the failing stage was not predicted Never got past import rclpy (stages reached: start only), exit 1, python_exception_reported: false, 1 stderr line, 83.6–124.0 ms wall time
Same distro, same RMW: 1 publisher, 1 subscriber in separate processes, 200 messages (RELIABLE, KEEP_LAST depth 200, 0.01 s apart) Most or all received 200 sent, 200 received, 200 unique, 0 duplicates, 0 out of order, received_ratio 1.0. Matched after 100.8–100.9 ms. Both processes reported jazzy and rmw_fastrtps_cpp

Every result matched its prediction. For the two cases the plan left open, the double source did not duplicate any path entry, and the missing RMW stopped the process at import rclpy, before rclpy.init() or node creation. Three raw lines from run 1:

{"measure": "shell_state", "state": "jazzy_then_missing_distro", "sources": ["/opt/ros/jazzy/setup.bash", "/opt/ros/kilted/setup.bash"], "source_exit_codes": [0, 1], "bash_exit_code": 0, "stderr_first_line": "bash: line 2: /opt/ros/kilted/setup.bash: No such file or directory", "ROS_DISTRO": "jazzy", "ROS_VERSION": "2", "RMW_IMPLEMENTATION": null, "ament_prefix_entries": 1, "ament_prefix_unique": 1, "path_entries_opt_ros": 1, "path_entries_opt_ros_unique": 1, "pythonpath_entries_opt_ros": 1, "ld_library_path_entries_opt_ros": 2, "ros_env_var_count": 5, "ros2_on_path": true, "elapsed_ms": 189.8}
{"measure": "rmw_probe", "RMW_IMPLEMENTATION": "rmw_cyclonedds_cpp", "exit_code": 1, "stages_reached": ["start"], "python_exception_reported": false, "stderr_line_count": 1, "stderr_first_rmw_line": "[ERROR] [1795108824.034337723] [rcl]: Error getting RMW implementation identifier / RMW implementation not installed (expected identifier of 'rmw_cyclonedds_cpp'), with error message 'failed to load shared library 'librmw_cyclonedds_cpp.so'", "wall_ms": 87.2}
{"measure": "summary", "total_wall_s": 6.76}

What the measurements mean, and what they don't

The jazzy_then_missing_distro line is something that can really happen in a .bashrc. If you remove a second distro and forget its source line, or add the line before the install finishes, every new terminal prints one error and then opens as if nothing went wrong. It is still a Jazzy shell. You may think you are testing the second distro while Jazzy is the one running. That is why we check echo $ROS_DISTRO every time we open a terminal.

The rmw_probe line is what you get when .bashrc exports an RMW you never installed. A Python node launched from that terminal ends at import rclpy. No Python exception is raised, so your own error handling never runs. Our first version of the probe printed its result only at the end, and it printed nothing at all. We only saw where it stopped after changing it to print a line after each stage. If a node exits without a traceback, run printenv RMW_IMPLEMENTATION before you look anywhere else. The [rcl] line on stderr is the only clue you get.

Limits of these measurements:

  • Sourcing Jazzy twice is not the same as sourcing Jazzy and then a different, installed distro. We could not measure that mixed shell, and the official docs don't describe what it looks like either. That is why we recommend not doing it, rather than claiming it breaks in a specific way.
  • The 200-message result is a baseline for the supported case: two processes, one container, same host, no network. It says nothing about delivery between different distros or different RMW vendors, and nothing about traffic between machines.
  • Timings come from a 1-CPU container. They are not performance figures.
  • No robot or simulator was involved.

The script, plan, and raw output from all five runs are in the experiment directory: experiment.py, plan.md, results.json. To rerun it with Docker:

mkdir ros2-distro-check && cd ros2-distro-check
curl -fsSLO https://raw.githubusercontent.com/sungpyo9053/blog/main/experiments/ros2-multiple-distros-one-machine-mixed-node-pairs/experiment.py
sha256sum experiment.py
docker run --rm --network none --cpus 1 --memory 1g -v "$PWD":/work \
  ros@sha256:00b8d47a6e6384a2834e3d01fa87ae767876543baa574f2d64a75c04ea33c698 \
  bash -c "source /opt/ros/jazzy/setup.bash && python3 /work/experiment.py"

If the hash matches script_sha256 in results.json, you are running the same file. A good run prints one JSON line per measurement, ends with a "measure": "summary" line, and exits 0. Timings will vary a little. If either baseline process fails, the script exits 1.

Which distros apt can install next to Jazzy depends on your Ubuntu codename

Binary ROS 2 packages are namespaced by distro. The package is ros-jazzy-ros-base and the files go under /opt/ros/jazzy (Ubuntu install guide). Because two distros never share a path, they can sit on the same disk. The Jazzy "Configuring environment" tutorial says this directly: it "allows the installation of several ROS 2 distributions (or "distros", e.g. Dashing and Eloquent) on the same computer and switching between them." The Rolling version of that page was rewritten as a how-to in August 2026 and no longer has that sentence. We could not confirm whether that reflects a policy change.

So the docs do say multiple distros are possible. What they leave out is apt. The ROS apt repository is split by Ubuntu codename, and each distro ships debs only for specific codenames. In the platform tables, a Tier 1 entry marked [d] means debs are provided. Tier 3 means you have to build from source. Here is that table from the point of view of a Noble machine that already runs Jazzy:

Distro Ubuntu with debs apt install on 24.04 Noble? EOL (Releases table)
Humble 22.04 Jammy No May 2027
Jazzy 24.04 Noble Yes May 2029
Kilted 24.04 Noble Yes December 2026 (REP 2000: November 2026)
Lyrical 26.04 Resolute No (Noble is Tier 3, source build only) May 2031
Rolling 24.04 Noble, per its release page Yes on paper, but the platform can change None (continuously updated)

Sources: Humble release page (rst), Jazzy release page, Kilted release page, Lyrical supported platforms, Rolling Ridley, REP 2000, ROS 2 Distributions.

This table rules out the most common attempt: you cannot apt install Humble on an Ubuntu 24.04 machine that runs Jazzy, because the Humble debs are built for Jammy. Lyrical has the longest support window, but it also needs Ubuntu 26.04 to install through apt. On a Noble machine, the only apt candidates to install next to Jazzy are Kilted and Rolling.

Before installing, ask apt two questions

Even when the codename matches, no document tells you what apt will change on your machine when the second distro's dependencies are resolved. So ask apt first. Is there a candidate for this distro on my codename? And will installing it remove anything?

. /etc/os-release && echo "$UBUNTU_CODENAME"
sudo apt update
for d in jazzy kilted lyrical rolling; do
  if apt-cache show --no-all-versions "ros-$d-ros-base" >/dev/null 2>&1; then
    echo "$d: candidate available"
  else
    echo "$d: no candidate"
  fi
done
apt-cache policy ros-kilted-ros-base
apt-get install -s ros-kilted-ros-base | grep -E '^Remv ' || echo "no Remv lines"

How to read the output:

  • apt-cache show --no-all-versions exits 0 when a candidate exists and 100 when it doesn't. The loop uses that exit status.
  • apt-get install -s only simulates the install. It installs nothing, runs without root, and prints Inst, Conf and Remv lines. If you see even one line starting with Remv , installing the second distro would remove an existing package. Stop there.
  • Don't use apt-cache policy to decide whether a candidate exists. Given a package name that doesn't exist, it still exits 0 and simply prints nothing for that name. Use it only to read the candidate version string and the build date inside it. If you are considering Rolling, check that the date is recent, because the install guide warns that Rolling's supported platforms can change.

To check another distro, replace kilted in the last two lines. The command syntax and exit codes were checked in a throwaway ros:jazzy-ros-base (Noble) container. How many packages show up, and whether you get Remv lines, depends on the repository state and on what you have installed, so we don't report those numbers. The block assumes the ROS apt source is already configured, which it is if you installed your first distro by following the official guide. If you later want to remove only the second distro, the install guide's pattern selects it by name: sudo apt remove '~nros-kilted-*' && sudo apt autoremove.

One distro per terminal, and keep it out of .bashrc

source runs a script inside your current shell. ROS 2's setup.bash uses it to set ROS_DISTRO, AMENT_PREFIX_PATH, PATH, PYTHONPATH and related variables. Those variables decide which distro a terminal is actually using.

The official guidance has two parts. Source the setup file in every new shell, or add it to .bashrc. Then run printenv | grep -i ROS to confirm that ROS_DISTRO is the distro you intended (Rolling how-to). Every example sources a single distro. The docs have no .bashrc rules for machines with several distros, and they don't describe a shell where one distro has been sourced on top of another. The Jazzy tutorial explains underlays and overlays only for workspaces.

The accepted answer on the Robotics Stack Exchange question "Multiple ROS installation on single machine" (2022) recommends using one distro at a time and not sourcing it from .bashrc. An answers.ros.org reply from 2014 gives the same advice. We follow it, but note that it comes from the community, not from the official docs. Comment out the source /opt/ros/jazzy/setup.bash line in .bashrc, and in each new terminal source exactly one distro and check it:

source /opt/ros/jazzy/setup.bash
echo "$ROS_DISTRO"

If it prints jazzy, that terminal is a Jazzy terminal. For Kilted, open a new terminal and change both lines to kilted. Don't source a second distro in a terminal that already has one. Nothing documents what that state looks like, and as the measurement above shows, a failed second source leaves you on the first distro without any obvious warning.

Mixed distros or mixed RMW vendors are outside the support guarantee

ROS 2 doesn't move messages on its own. It passes them through the RMW (ROS middleware interface) to a vendor implementation, usually DDS. Jazzy defaults to Fast DDS (rmw_fastrtps_cpp), and the RMW_IMPLEMENTATION environment variable can switch to another implementation at runtime, provided it is installed (Working with multiple RMW implementations).

The Cross-Distribution Communications section of ROS 2 Distributions says:

Nodes are not guaranteed to be able to communicate across distributions. … It may or may not work, but it is not supported and should not be relied upon. Note that cross-vendor (single-distro) communications are also not guaranteed.

Note the second sentence. Matching the distro is not enough, because two Jazzy nodes using different RMW vendors are also outside the guarantee. About Different Middleware Vendors adds that different DDS implementations often can talk to each other, but not in every case, and recommends using the same ROS version and the same RMW implementation across a distributed system.

"Not guaranteed" doesn't mean "will fail". The docs themselves say it may or may not work. The problem is that you have nothing to rely on if it does work. The reasons it can break come from a forum thread, not from the docs. In the Open Robotics Discourse thread "Incompatability between distributions" (May 2025), gavanderhoorn points to serialization changes around type descriptions introduced in Iron, a changed GID storage format, and different Fast DDS versions. He explains that even when the message definitions are identical, the byte stream between Humble-and-older and Iron-and-newer is incompatible. Katherine Scott recommends in the same thread not mixing nodes across distros and notes that there are no tests or guarantees for it. These are maintainer comments, so we don't treat them as an official ruling on any particular pair of distros.

If your graph contains mixed nodes, you have two clean options. Rebuild the odd node on the same distro and RMW as the rest, or keep each group isolated. One way to isolate groups is to give them different ROS_DOMAIN_ID values, since nodes only communicate within the same domain (Jazzy tutorial). That keeps the groups from talking to each other at all. It doesn't make mixing safe. It removes the mixing.

Count the unsupported node pairs before you run the graph

The two sentences quoted above can be turned into a number. Label each node with its (distro, RMW) group. Pairs inside the same group are supported, and every other pair is not. Assume the worst case, where every node talks to every other node. With n nodes split into groups of size k1, …, km:

unsupported pairs = n(n−1)/2 − Σ kᵢ(kᵢ−1)/2

A made-up 6-node graph: four Jazzy + Fast DDS nodes, one Jazzy node on a different RMW (say Cyclone DDS), and one Kilted + Fast DDS node.

  • Total pairs: 6·5/2 = 15.
  • Supported pairs: only those among the four Jazzy + Fast DDS nodes, 4·3/2 = 6. A group with one node contributes no pairs.
  • Unsupported: 15 − 6 = 9, or 60% of all pairs.
  • Of those, 5 come from the distro difference (the Kilted node with each of the other five) and 4 from the RMW difference inside Jazzy (the Cyclone node with the four Fast DDS nodes). 5 + 4 = 9.

If all six nodes are in one group, the answer is 15 − 15 = 0. If five share a group and one node is on another distro, it is 15 − 10 = 5, a third of the graph. A single node alone in its group makes its pair with every other node unsupported, so the damage grows with the graph: n − 1 pairs. With 10 nodes and one built for Kilted, you get 45 − 36 = 9 unsupported pairs. If you rebuild that node on Jazzy but leave it on Cyclone DDS, you still have 9, because a vendor difference inside one distro is also unsupported.

The arithmetic is checked with asserts in example.py, and verification.json records a passing run. It was also checked by listing every pair directly. This count is not a number of failing links, and it says nothing about delivery rate or latency. Counting only the pairs that actually share a topic gives a smaller number, and services, actions and parameters are not counted separately. Still, any result above zero tells you which node to rebuild or isolate.

Picking the second distro on Noble: Kilted is ending, Rolling keeps changing

Kilted's EOL is December 2026 in the Releases table and "May 2025 - November 2026" in REP 2000. As of November 2026 that leaves one month or none, depending on which source you trust. Rolling has no EOL, but the Releases page warns that it "can have in-place updates that include breaking changes" and recommends the latest stable distro for most users.

So on a Noble machine running Jazzy, apt offers no second distro that you can keep for long. There is little reason to install Kilted now. Rolling is fine for a short look at upcoming features, as long as you accept breaking updates and check the build date in apt-cache policy first. If you plan to move to the next distro for real, plan for Lyrical on Ubuntu 26.04, either on another machine or after an OS upgrade, instead of adding it to this one.

If your actual goal is to run nodes from two distros in one robot graph, installing is the smaller problem. First get the unsupported-pair count to zero, by rebuilding nodes on one distro and one RMW or by separating the groups with ROS_DOMAIN_ID.

Before installing anything, open the ROS 2 Distributions table and the supported-platforms page for your second distro (for example Lyrical), and check your Ubuntu codename and the EOL date.

Sources (checked 2026-11-20)