Last active
August 29, 2025 21:32
-
-
Save chutsu/59a51a2a1954f0c6bafb06a3e4056282 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| # Settings | |
| USER_HOME=$(eval echo "~$SUDO_USER") | |
| CHROOT_DIR=${USER_HOME}/bootstrap | |
| UBUNTU_VERSION="focal" | |
| ROS_VERSION="noetic" | |
| # Script dependencies | |
| apt-get update -q | |
| apt-get install -q debootstrap wget curl lsb-release | |
| # Bootstrap Ubuntu base installation | |
| mkdir -p ${CHROOT_DIR} | |
| if [ ! -f "${CHROOT_DIR}/bin/bash" ]; then | |
| debootstrap $UBUNTU_VERSION $CHROOT_DIR http://archive.ubuntu.com/ubuntu | |
| fi | |
| # Setup APT sources | |
| cat > ${CHROOT_DIR}/etc/apt/sources.list <<EOF | |
| deb http://archive.ubuntu.com/ubuntu $UBUNTU_VERSION main universe restricted multiverse | |
| deb http://archive.ubuntu.com/ubuntu $UBUNTU_VERSION-updates main universe restri | |
| i | |
| cted multiverse | |
| deb http://archive.ubuntu.com/ubuntu $UBUNTU_VERSION-security main universe restricted multiverse | |
| deb http://packages.ros.org/ros/ubuntu $UBUNTU_VERSION main | |
| EOF | |
| # Install ROS | |
| cat << 'EOF' | chroot $CHROOT_DIR /bin/bash | |
| export DEBIAN_FRONTEND=noninteractive | |
| apt-get install -yqq curl | |
| curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - | |
| apt-get install -yqq ros-noetic-ros-base | |
| exit | |
| EOF | |
| ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment