ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can I install ros2 on non lts ubuntu (like ubuntu 22.10)?

asked 2023-03-29 05:08:40 -0500

Mikita Saladukha gravatar image

Is it possible to install ros 2 (for example, ros2 humble, or future ros2 iron) in non-long-term-support versions of Ubuntu? Like ubuntu 22.10, or future ubuntu 23.04?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2023-06-23 16:08:16 -0500

ryanf55 gravatar image

updated 2023-06-23 16:54:36 -0500

Honestly, I can't recommend this, it's quite difficult on Ubuntu 23.04, but is a necessary evil in certain situations.

I filed this issue for rosdep: https://github.com/ros2/ros2_document... In ubuntu 23, it's STRONGLY not recommend to use pip at the system level.

For example, you can't do a python3 -m pip install rosdep with default settings, you need to do it in a virtualenv or use pipx. Next, once you get rosdep install, you can't run rosdep with sudo because it's not installed on sudo.

(.venv) $ sudo python3 -m pip install rosdep
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

That said, you can install python3-rosdep2 with apt and it works. However, that's just the first package. If I end up finding a better solution, I can update this answer for how to do it on Ubuntu 23.04...

I filed this issue, just a developer warning, you might see depending on if you CMake version is 3.27 or greater.

https://github.com/ros2/python_cmake_...

When you upgrade, it comes with a new G++ version from 11 to 12, so a bunch of -Wdeprecated-declaration warnings pop up. Luckily, most repos don't enable Werr.

Here's the full list of commands I used to build and install ROS 2 rolling on Ubuntu 23.

Since this is not a supported distro, this might break. However, I think you'll find maintainers are more than happy to accept PR's for upcoming distros.

# https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Development-Setup.html#install-development-tools
sudo apt update && sudo apt install -y \
  python3-flake8-docstrings \
  python3-pip \
  python3-pytest-cov \
  python3-flake8-blind-except \
  python3-flake8-builtins \
  python3-flake8-class-newline \
  python3-flake8-comprehensions \
  python3-flake8-deprecated \
  python3-flake8-import-order \
  python3-flake8-quotes \
  python3-pytest-repeat \
  python3-pytest-rerunfailures \
  python3-rosdep2 \
  vcstool \
  colcon

mkdir -p ~/ros2_rolling/src
cd ~/ros2_rolling
vcs import --input https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos src

sudo apt upgrade
sudo rosdep init
rosdep update
# Add in the -r flag, some packages have keys they don't use
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers" --os  ubuntu:lunar --rosdistro rolling -r

colcon build

At this point, I have a ROS 2 installation in Ubuntu 23.04.

edit flag offensive delete link more
0

answered 2023-03-31 00:24:19 -0500

Yes, if you build from source! No promises if you’ll run into issues, but it should be largely painless unless you’re going far backward

edit flag offensive delete link more

Comments

From source is the only way? From repository is not supported?

Mikita Saladukha gravatar image Mikita Saladukha  ( 2023-03-31 06:37:54 -0500 )edit

The repository is the source code.

stevemacenski gravatar image stevemacenski  ( 2023-03-31 10:57:24 -0500 )edit

How about installing ros 2 with command "sudo apt install ..."? It is not supported in non-lts versions of Ubuntu?

Mikita Saladukha gravatar image Mikita Saladukha  ( 2023-04-01 02:50:06 -0500 )edit

As I said, no, that will not work, you need to build from source.

stevemacenski gravatar image stevemacenski  ( 2023-04-04 10:19:04 -0500 )edit

Did you make progress on this? I'm trying to build from source on 23.04

ryanf55 gravatar image ryanf55  ( 2023-06-23 15:32:58 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-03-29 05:08:40 -0500

Seen: 564 times

Last updated: Jun 23 '23