A Practical Guide to Installing Ubuntu 20.04 and Essential Development Software
System Installation for Ubuntu 20.04
Obtain the Ubuntu 20.04 LTS installation image from the official website. To create bootable media, use tools like dd on Linux or Rufus on Windows. Ensure your system's BIOS/UEFI is configured to boot from the USB drive.
Partitioning Strategy
When installing, you will be prompted to partition your disk. Here are common approaches:
- Simple Setup: A single root (
/) partition using the entire disk space, optionally with a swap file instead of a partition. - Advanced Setup: Separate partitions for root (
/), home (/home), and swap. A typical scheme for a 256GB disk could be:swap: Logical partition, size equal to system RAM (e.g., 8GB)./boot: Primary partition, 512MB, Ext4 filesystem./: Primary partition, 50GB, Ext4 filesystem./home: Logical partition, remaining space, Ext4 filesystem.
Post-Installation Configuration
After installation, update the system and install fundamental development tools.
sudo apt update && sudo apt upgrade -y
sudo apt install -y vim git curl wget build-essential cmake gdb
Graphics Driver Installation
For systems with NVIDIA GPUs, install the proprietary drivers.
# Identify recommended driver
ubuntu-drivers devices
# Install the recommended driver
sudo ubuntu-drivers autoinstall
sudo reboot
Setting Up a Development Environment
Installing and Configuring ROS Noetic
ROS Noetic is the version compatible with Ubuntu 20.04.
# Set up sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Set up keys
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
# Install ROS
sudo apt update
sudo apt install -y ros-noetic-desktop-full
# Initialize environment
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Essential Libraries and Tools
Installing g2o
sudo apt install -y libeigen3-dev libsuitesparse-dev qt5-qmake libqglviewer-dev-qt5
cd ~
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
Installing Ceres Solver
sudo apt install -y libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev
cd ~
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
Installing Sophus (Non-Template Version)
cd ~
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff2
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
Development Workspace Management
Create a Catkin workspace for ROS development.
mkdir -p ~/dev_ws/src
cd ~/dev_ws/src
catkin_init_workspace
cd ~/dev_ws
catkin_make
source devel/setup.bash
Place your source code in the src directory and use catkin_make to build.
Useful System Utilities
Network Monitoring Tool
Display real-time network speed in the system panel.
sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt update
sudo apt install -y indicator-sysmonitor
# Run the indicator
indicator-sysmonitor &
Advanced Terminal: Terminator
sudo apt install -y terminator
Common Terminator shortcuts:
Ctrl+Shift+E: Split pane vertically.Ctrl+Shift+O: Split pane horizontally.Ctrl+Shift+W: Close the current pane.Ctrl+Shift+NorCtrl+Tab: Move to the next pane.
Screen Recording
sudo apt install -y kazam
Fixing System Time Conflict with Windows
If dual-booting with Windows, Ubuntu's time may be incorrect. To sync the hardware clock to local time:
sudo timedatectl set-local-rtc 1 --adjust-system-clock
Sensor Driver Installation Examples
RoboSense LiDAR ROS Driver
Install dependencies and compile the driver.
# Install libpcap for packet capture
sudo apt install -y libpcap-dev
# Clone and build the driver
cd ~/dev_ws/src
git clone https://github.com/RoboSense-LiDAR/ros_rslidar.git
cd ~/dev_ws
catkin_make --pkg rslidar_driver rslidar_pointcloud rslidar_msgs
source devel/setup.bash
Microsoft Azure Kinect ROS Driver
First, install the Azure Kinect Sensor SDK.
cd ~
git clone https://github.com/microsoft/Azure-Kinect-Sensor-SDK.git
cd Azure-Kinect-Sensor-SDK
git checkout v1.4.1
mkdir build && cd build
cmake .. -GNinja
ninja
sudo ninja install
# Set up udev rules
sudo cp ../scripts/99-k4a.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
Then, install the ROS wrapper.
cd ~/dev_ws/src
git clone https://github.com/microsoft/Azure_Kinect_ROS_Driver.git
cd ~/dev_ws
catkin_make --pkg azure_kinect_ros_driver
source devel/setup.bash