Skip to content

Instantly share code, notes, and snippets.

@Meltwin
Last active April 6, 2025 21:12
Show Gist options
  • Save Meltwin/fe2c15a5d7e6a8795911907f627255e0 to your computer and use it in GitHub Desktop.
Save Meltwin/fe2c15a5d7e6a8795911907f627255e0 to your computer and use it in GitHub Desktop.
Installing ROS1 Noetic on Ubuntu 22.04

I made a repository where you can create issues if you have any problem during manual installation of ROS1. It will hopefully help people to find their problem more quickly. If you have any problem with the steps below, please:

  1. Check if someone else had the same problem below this gist,
  2. Create an issue on this repository otherwise.

The process is pretty similar to the standard installation from source except for some fixes that you will have to make during the installation. I will keep the same header so you can keep a track on both guide at the same time (follow the official website for more explication, I will only write the steps to make).

1 - Prerequisites

1.1 - Installing bootstrap dependencies

To install bootstrap dependencies

sudo apt-get install python3-rosdep python3-rosinstall-generator python3-vcstools python3-vcstool build-essential

1.X - Changing rosdep repository adress

The first problem that you will encounter while following the official guide is the lacking of some packages on the apt. In order to resolve this problem, do these steps:

  1. Init rosdep: sudo rosdep init
  2. Modify /etc/ros/rosdep/sources.list.d/20-default.list as following:
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml <enter base.yaml address>
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
  1. Go to this gist and click Raw. Replace <enter base.yaml address> in the file by the address of the raw file.
  2. Save the file (require sudo rights).

1.Y - HDDTemp can't be found

It can happens that the package hddtemp can't be found with an error message similar to this:

diagnostic_common_diagnostics: [hddtemp] defined as "not available" for OS version [*]

For Ubuntu 22.04, it is possible to install it thanks to an online archive. The solution I found was on this StackOverflow post. What you have to do is:

sudo add-apt-repository ppa:malcscott/ppa
sudo apt update 
sudo apt install hddtemp

1.2 - Initializing rosdep

rosdep update

2 - Installation

2.1 - Create a catkin Workspace

Place yourself in the working folder of your choice. Create a ROS Workspace:

mkdir ./noetic_ws
cd ./noetic_ws

Downloading ROS1 source code.

rosinstall_generator desktop --rosdistro noetic --deps --tar > noetic-desktop.rosinstall
mkdir ./src
vcs import --input noetic-desktop.rosinstall ./src

2.1.1 - Resolving Dependencies

Install all the dependencies with rosdep:

rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y

If you are on another distro than classical Ubuntu/Kubuntu/Xubuntu (e.g. Manjaro, Mint, ...), add --os=ubuntu:jammy at the end of the precendent command:

2.1.2 - Building the catkin Workspace

2.1.2.A Building from the source

Let's build the sources. Run the following commands.

./src/catkin/bin/catkin_make_isolated -DCMAKE_BUILD_TYPE=Release

It's likely that you will have some errors while building the sources. In the next subsections, you will have the needed steps to resolve the issue.

Don't worry about the warning and notes (especially about deprecated BOOST_PRAGMA_MESSAGE ), only focus on the errors.

2.1.2.B - Fixing rosconsole error

The second error that you will likely encounter is linked to rosconsole and log4cxx. It means that you are likely to have log4cxx 11 or 12. To fix that you need to follow the changes suggested on this PR and especially this commit. Here is a quick summary of what to do:

  • Open src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp and replace its content by this version of the file
  • Same thing with src/rosconsole/test/thread_test.cpp with this version
  • Same thing with src/rosconsole/test/utest.cpp with this version
2.1.2.C - Fixing std::share_mutex error

The third error that you will likely encounter is a C++ compilation version. It's a problem where the packages wants to be compiled with C++11 and use objects from C++17.

The solution that I found was to change in every CMakeLists.txt of the packages that generate this errors the C++ version to use.

You can use this small python script to do that for you. Just place it at the root of your ROS workspace and run

python3 change_cpp.py
2.1.2.D - Installing noetic
Guide installation

If you want to install noetic in the working folder, run the installation with:

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Opt folder installation (require sudo privileges)

If you want to install noetic in /opt/ros/noetic you can follow these steps:

  1. Run sudo mkdir /opt/ros/noetic
  2. Run sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic
@SirTobias
Copy link

SirTobias commented Dec 27, 2024 via email

@eleboss
Copy link

eleboss commented Jan 2, 2025

appreciate for the note. really detailed and would definitely works on x86/64.
For thoes using arm or chasing for a simpler solution: you can try the robostack, really a life saver.
https://robostack.github.io

@anton-pintya
Copy link

anton-pintya commented Feb 8, 2025

Trying to install ROS1 Noetic on Ubuntu 22.04 by command:
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic
Building isolated ROS1 by ./src/catkin/bin/catkin_make_isolated -DCMAKE_BUILD_TYPE=Release succed and created folder build_isolated, then I supposed to install it in /opt/ros/noetic as already installed on my PC /opt/ros/humble, but got this error:

==> Processing catkin package: 'actionlib_msgs'
==> Building with env: '/opt/ros/noetic/env.sh'
==> cmake /home/apin/noetic_ws/src/common_msgs/actionlib_msgs -DCATKIN_DEVEL_PREFIX=/home/apin/noetic_ws/devel_isolated/actionlib_msgs -DCMAKE_INSTALL_PREFIX=/opt/ros/noetic -DCMAKE_BUILD_TYPE=Release -G Unix Makefiles in '/home/apin/noetic_ws/build_isolated/actionlib_msgs'
-- Using CATKIN_DEVEL_PREFIX: /home/apin/noetic_ws/devel_isolated/actionlib_msgs
-- Using CMAKE_PREFIX_PATH: /opt/ros/noetic
-- This workspace overlays: /opt/ros/noetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/apin/noetic_ws/build_isolated/actionlib_msgs/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Using Python nosetests: /usr/bin/nosetests3
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /home/apin/noetic_ws/build_isolated/actionlib_msgs/cmake/actionlib_msgs-genmsg.cmake:3 (message):
  Could not find messages which
  '/home/apin/noetic_ws/src/common_msgs/actionlib_msgs/msg/GoalStatusArray.msg'
  depends on.  Did you forget to specify generate_messages(DEPENDENCIES ...)?

  Cannot locate message [Header] in package [std_msgs] with paths
  [['/home/apin/noetic_ws/devel_isolated/std_msgs/share/std_msgs/cmake/../msg']]
Call Stack (most recent call first):
  /home/apin/noetic_ws/devel_isolated/genmsg/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
  CMakeLists.txt:12 (generate_messages)


-- Configuring incomplete, errors occurred!
See also "/home/apin/noetic_ws/build_isolated/actionlib_msgs/CMakeFiles/CMakeOutput.log".
<== Failed to process package 'actionlib_msgs':
...

I checked CMakeLists.txt in src/common_msgs/action_msgs/, everything seems to be okay:

cmake_minimum_required(VERSION 3.0.2)
project(actionlib_msgs)

find_package(catkin REQUIRED COMPONENTS message_generation std_msgs)

add_message_files(
  DIRECTORY msg
  FILES
  GoalID.msg
  GoalStatus.msg
  GoalStatusArray.msg)
generate_messages(DEPENDENCIES std_msgs)

catkin_package(
  CATKIN_DEPENDS message_runtime std_msgs
  CFG_EXTRAS actionlib_msgs-extras.cmake)

# install the .action -> .msg generator
catkin_install_python(PROGRAMS scripts/genaction.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

# install the legacy rosbuild cmake support
install(FILES cmake/actionbuild.cmake
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake)

Also tried to use command sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic -DPYTHON_EXECUTABLE=/usr/bin/python3 -j1, but result was the same. This was a 100-th stage of installing out of 184. I downloaded all neccessary libraries and modules listed in this guide (and during isolated building everything is fine), but everytime I get the same error. What am I missing?


UPD: I fixed this error and corresponding error with <== Failed to process package 'actionlib_msgs' by uninstalling empy:

pip uninstall empy
pip install empy==3.3.4

Which is used for ROS and PX4 building (I had empy==4.0.X). Then I deleted already built directories and launch installing to /opt/ros/noetic again. This fixed all problems

@GNDeSouza
Copy link

GNDeSouza commented Feb 13, 2025

“./src/catkin/bin/catkin_make_isolated -j10

this is a broken installation for Noetic on ubuntu 22.04 , dear...kindly try to fix this....

I have recently used my 'recipe' in two other computers, and it works fine. Check it here:

https://github.com/GNDeSouza/ROS-Noetic-and-Gazebo-in-Ubuntu-22.04

@GNDeSouza
Copy link

Which is used for ROS and PX4 building (I had empy==4.0.X). Then I deleted already built directories and launch installing to /opt/ros/noetic again. This fixed all problems

I would follow my recipe (link below). I recently applied it to a machine with humble already installed, and I can now use both.

https://github.com/GNDeSouza/ROS-Noetic-and-Gazebo-in-Ubuntu-22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment