Installing Ubuntu: A Complete Guide for AI Development

30 minutes | Beginner | Module 1 of 5

Ubuntu is one of the most popular Linux distributions, known for its user-friendly interface and robust support for development tools. This guide will walk you through the process of installing Ubuntu on your computer, preparing you for AI development work.

Understanding Ubuntu

Ubuntu is an open-source operating system based on the Linux kernel. It's maintained by Canonical Ltd. and released in regular versions, with both long-term support (LTS) releases and interim releases. For AI development, we recommend using the latest LTS version as it provides stability and support for a longer period (typically 5 years).

The current LTS version at the time of writing is Ubuntu 22.04 LTS (Jammy Jellyfish), which will be used throughout this guide. However, the installation process remains largely similar across different versions.

Before You Begin

Before installing Ubuntu, there are several important considerations to keep in mind:

System Requirements

Ubuntu 22.04 LTS has the following minimum system requirements:

  • 2 GHz dual-core processor or better
  • 4 GB RAM (system memory)
  • 25 GB of free hard drive space
  • Internet access is helpful
  • Either a DVD drive or a USB port for the installer media

For AI development work, we recommend:

  • Quad-core processor or better
  • 8 GB RAM minimum (16 GB or more recommended)
  • 50 GB+ of free storage space
  • NVIDIA GPU (for machine learning tasks)

Backup Your Data

If you're installing Ubuntu on a machine that already has data on it, make sure to back up all important files. The installation process can potentially erase existing data, especially if you're planning to replace your current operating system entirely.

Installation Methods

There are several ways to install Ubuntu:

  1. Dual-boot: Install Ubuntu alongside your existing operating system (like Windows or macOS)
  2. Single-boot: Replace your existing operating system with Ubuntu
  3. Virtual machine: Run Ubuntu inside your current operating system using software like VirtualBox or VMware
  4. Windows Subsystem for Linux (WSL): Run Ubuntu within Windows without a full installation

For this guide, we'll focus on the dual-boot and single-boot methods, as they provide the best performance for AI development work.

Creating Installation Media

To install Ubuntu, you'll need to create installation media using either a USB drive (recommended) or a DVD.

Download Ubuntu ISO

  1. Visit the official Ubuntu website at ubuntu.com/download/desktop
  2. Click on the download button for Ubuntu 22.04 LTS
  3. The download will begin automatically (the file is approximately 3.5 GB)

Creating a Bootable USB Drive

For Windows Users:

  1. Download and install Rufus, a free and open-source USB writing tool, from rufus.ie
  2. Insert your USB drive (minimum 4GB capacity)
  3. Open Rufus
  4. Select your USB drive in the "Device" dropdown
  5. Click the "SELECT" button and navigate to your downloaded Ubuntu ISO file
  6. Keep the default settings for partition scheme and target system
  7. Click "START" to begin the process
  8. If prompted about ISO image mode, select "Write in ISO Image mode" and click "OK"
  9. Confirm that you understand all data on the USB will be destroyed
  10. Wait for the process to complete (usually takes 5-10 minutes)

For macOS Users:

  1. Download and install Etcher from balena.io/etcher
  2. Insert your USB drive (minimum 4GB capacity)
  3. Open Etcher
  4. Click "Flash from file" and select your downloaded Ubuntu ISO
  5. Click "Select target" and choose your USB drive
  6. Click "Flash!" to begin the process
  7. You may be asked for your administrator password
  8. Wait for the process to complete (usually takes 5-10 minutes)

For Linux Users:

If you're already using Linux, you can use the built-in "Startup Disk Creator":

  1. Insert your USB drive
  2. Open "Startup Disk Creator" from your applications menu
  3. Select your downloaded Ubuntu ISO file
  4. Select your USB drive
  5. Click "Make Startup Disk"
  6. Wait for the process to complete

Installing Ubuntu

Now that you have your bootable USB drive ready, it's time to install Ubuntu.

Booting from USB

  1. Insert the bootable USB drive into your computer
  2. Restart your computer
  3. As your computer starts up, you'll need to access the boot menu or BIOS/UEFI settings:
    • On most computers, you can press F12, F2, F1, Esc, or Delete during startup (the exact key varies by manufacturer)
    • On newer Windows machines, you can hold Shift while clicking Restart, then navigate to Troubleshoot > Advanced options > UEFI Firmware Settings
  4. In the boot menu, select your USB drive
  5. Your computer will now boot from the USB drive and load the Ubuntu installer

Installation Process

  1. Once Ubuntu loads, you'll see two options: "Try Ubuntu" or "Install Ubuntu"
    • "Try Ubuntu" lets you test Ubuntu without making any changes to your computer
    • "Install Ubuntu" starts the installation process immediately
  2. For this guide, select "Install Ubuntu"
  3. Select your language and click "Continue"
  4. On the "Updates and other software" screen:
    • Choose "Normal installation" for a complete desktop environment
    • Check "Download updates while installing Ubuntu"
    • If you plan to work with machine learning, check "Install third-party software for graphics and Wi-Fi hardware and additional media formats"
    • Click "Continue"
  5. On the "Installation type" screen, you'll have several options:
    • "Erase disk and install Ubuntu" (single-boot, replaces existing OS)
    • "Install Ubuntu alongside [your current OS]" (dual-boot)
    • "Something else" (manual partitioning for advanced users)

    For beginners, we recommend:

    • Choose "Install Ubuntu alongside [your current OS]" if you want to keep your existing operating system
    • Choose "Erase disk and install Ubuntu" if you want to replace your existing operating system

    Then click "Install Now"

  6. If you selected dual-boot, you'll see a screen where you can allocate disk space between your existing OS and Ubuntu. Drag the divider to adjust the allocation (we recommend at least 50GB for Ubuntu if you'll be doing AI development), then click "Continue"
  7. Confirm the changes by clicking "Continue" when prompted
  8. Select your location on the map and click "Continue"
  9. Choose your keyboard layout and click "Continue"
  10. Create your user account:
    • Enter your name
    • Choose a computer name
    • Select a username
    • Create a strong password
    • Choose whether to require the password to log in (recommended)
    • Click "Continue"
  11. The installation will now begin. This process typically takes 10-20 minutes depending on your system's speed and whether you chose to download updates during installation.
  12. Once the installation is complete, you'll be prompted to restart your computer. Click "Restart Now"
  13. When prompted, remove the USB drive and press Enter

First Boot and Initial Setup

  1. After restarting, if you installed Ubuntu as a dual-boot system, you'll see the GRUB boot menu where you can choose between Ubuntu and your other operating system. Select Ubuntu.
  2. Log in using the username and password you created during installation
  3. Ubuntu will guide you through a few final setup steps:
    • Connect online accounts (optional)
    • Set up Livepatch for security updates (optional)
    • Choose whether to send system info to Canonical (optional)
    • Privacy settings (location services, etc.)
    • Software recommendations
  4. Once you complete these steps, you'll see the Ubuntu desktop

Post-Installation Setup

After installing Ubuntu, there are a few important steps to take to ensure your system is up-to-date and ready for AI development:

Update Your System

  1. Open Terminal by pressing Ctrl+Alt+T or searching for "Terminal" in the Activities menu
  2. Run the following commands:
sudo apt update
sudo apt upgrade -y

These commands refresh the package lists and install available updates for all installed software.

Install Essential Development Tools

For AI development, you'll need some basic development tools. Install them with:

sudo apt install build-essential git curl wget -y

This installs the C/C++ compiler, make, and other essential build tools, along with Git for version control and curl/wget for downloading files.

Graphics Drivers (for NVIDIA GPUs)

If you have an NVIDIA GPU and plan to do machine learning work, you'll need to install the appropriate drivers:

  1. Open "Software & Updates" from the Activities menu
  2. Go to the "Additional Drivers" tab
  3. Look for your NVIDIA graphics card and select the recommended proprietary driver
  4. Click "Apply Changes" and wait for the installation to complete
  5. Restart your computer when prompted

Alternatively, you can install the drivers via Terminal:

sudo ubuntu-drivers autoinstall
sudo reboot

Troubleshooting Common Installation Issues

Boot Issues

If your computer boots directly into your existing operating system without showing the GRUB menu:

  1. Restart your computer
  2. Access the BIOS/UEFI settings as described earlier
  3. Look for "Boot Order" or "Boot Sequence" settings
  4. Make sure that the drive where you installed Ubuntu is set as the first boot device
  5. Save changes and exit

Wi-Fi Not Working

If your Wi-Fi isn't working after installation:

  1. Connect to the internet using an Ethernet cable if possible
  2. Open Terminal and run:
sudo apt update
sudo apt install linux-firmware -y
sudo reboot

Display Resolution Issues

If your display resolution is incorrect:

  1. Go to Settings > Displays
  2. Select the appropriate resolution for your monitor
  3. Click "Apply"

If your desired resolution isn't available, you may need to install additional drivers as described in the "Graphics Drivers" section.

Conclusion

Congratulations! You've successfully installed Ubuntu and taken the first steps toward setting up your AI development environment. In the next guide, we'll explore the basics of using Ubuntu, including navigating the desktop environment, using the terminal, and managing software.

Remember that Linux is all about learning and exploration. Don't be afraid to try things out and search for solutions when you encounter issues. The Ubuntu community is vast and supportive, with countless resources available online to help you on your journey.