Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xXThanatosXx/MobileRobot/llms.txt

Use this file to discover all available pages before exploring further.

To cleanly remove ROS2 Humble from Ubuntu 22.04 you need to do three things: purge the ROS2 packages via APT, delete the APT source list entry that points to the ROS2 package repository, and remove the environment-sourcing lines that the installer added to your ~/.bashrc. Skipping any of these steps can leave stale configuration behind or cause confusing errors in future installs. Follow the steps below in order.
sudo apt remove --purge ros-humble-* removes all ROS2 Humble packages from your system. Make sure you do not have other projects or workspaces depending on them before running this command.

Uninstall Procedure

1

Open a new terminal

Press Ctrl + Alt + T to open a fresh terminal, or launch your preferred terminal emulator. Starting in a clean session ensures the ROS2 environment variables from the current shell do not interfere with the removal commands.
2

Purge all ROS2 Humble packages

Remove every installed ros-humble-* package along with its configuration files:
sudo apt remove --purge ros-humble-*
APT will show a list of packages to be removed and prompt for confirmation before proceeding.
3

Auto-remove unused dependencies

Clean up any orphaned dependency packages that were installed alongside ROS2 but are no longer needed by anything else on the system:
sudo apt autoremove
4

Remove the ROS2 APT source list

Delete the APT source file that was added during installation so that future apt update calls no longer query the ROS2 package repository:
sudo rm /etc/apt/sources.list.d/ros2.list
5

Update APT package index

Refresh the package index so APT reflects the removal of the ROS2 source:
sudo apt update
6

Edit ~/.bashrc to remove the ROS2 environment lines

Open your shell configuration file in the nano editor:
nano ~/.bashrc
Locate and delete the following line that sources the ROS2 environment (it was added by ros2_install.sh):
source /opt/ros/humble/setup.bash
If you also built a colcon workspace, remove the workspace overlay line as well:
source ~/colcon_ws/install/setup.bash
You can also remove any related alias or colcon-argcomplete lines if present:
alias nb='nano ~/.bashrc'
alias sb='source ~/.bashrc'
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
export ROS_DOMAIN_ID=0
Save the file with Ctrl + O, then exit with Ctrl + X.
7

Reload the shell configuration

Apply the updated ~/.bashrc without opening a new terminal:
source ~/.bashrc
8

Verify the removal

Confirm that ROS2 is no longer present on the system. This command should return an error or produce no output:
rosversion -d
If the command is not found, or returns command not found, ROS2 Humble has been successfully removed.
The colcon workspace directory at ~/colcon_ws is not deleted by this procedure — only the installed ROS2 packages are removed. If you no longer need the workspace source code and build artifacts, you can delete it manually:
rm -rf ~/colcon_ws
If you installed additional development tools alongside ROS2 (such as python3-colcon-common-extensions, python3-rosdep2, and python3-vcstool), you can remove them in a single command:
sudo apt remove --purge python3-colcon-common-extensions python3-rosdep2 python3-vcstool

Build docs developers (and LLMs) love