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 yourDocumentation 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.
~/.bashrc. Skipping any of these steps can leave stale configuration behind or cause confusing errors in future installs. Follow the steps below in order.
Uninstall Procedure
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.
Purge all ROS2 Humble packages
Remove every installed APT will show a list of packages to be removed and prompt for confirmation before proceeding.
ros-humble-* package along with its configuration files: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:
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:Edit ~/.bashrc to remove the ROS2 environment lines
Open your shell configuration file in the nano editor:Locate and delete the following line that sources the ROS2 environment (it was added by If you also built a colcon workspace, remove the workspace overlay line as well:You can also remove any related alias or colcon-argcomplete lines if present:Save the file with Ctrl + O, then exit with Ctrl + X.
ros2_install.sh):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: