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.