Chapter 1.6 - Installation and First Use
Overview
Before starting to use Linux, you need to install a Linux distribution. This chapter guides you through installing a Linux distribution and your first use of the system.
Objectives
By the end of this chapter, you will be able to:
- Choose an appropriate Linux distribution
- Install Linux (VM or dual-boot)
- Access the terminal
- Use basic commands
- Navigate the file system
What is a Linux Distribution?
A Linux distribution (or "distro") is a version of Linux with pre-installed tools, configurations, and software.
Popular distributions:
- Ubuntu: Easy to use, popular
- Debian: Stable, community-driven
- Red Hat/CentOS: Enterprise, stable
- Arch Linux: Advanced, customizable
Choosing a Distribution
For Beginners
Ubuntu:
- User-friendly graphical interface
- Large community
- Abundant documentation
- LTS (Long Term Support) support
Linux Mint:
- Based on Ubuntu
- Familiar interface (Windows style)
- Very user-friendly
For Servers
Ubuntu Server:
- LTS support
- Excellent documentation
- Large ecosystem
CentOS/Rocky Linux:
- Based on Red Hat
- Stable and reliable
- Popular in enterprises
For Learning
Debian:
- Solid base system
- In-depth learning
- Active community
Installation Methods
Option 1: Virtual Machine (Recommended for Beginners)
Advantages:
- No modification to your current system
- Easy to test
- Can be easily removed
Tools:
- VirtualBox: Free, cross-platform
- VMware: Powerful, paid
- Hyper-V: Windows (free)
Steps:
- Download VirtualBox
- Download an Ubuntu ISO
- Create a VM
- Install Ubuntu in the VM
Option 2: Dual-Boot
Advantages:
- Native performance
- Full hardware access
Disadvantages:
- Shared hard drive
- More complex to set up
Option 3: WSL (Windows Subsystem for Linux)
For Windows 10/11:
wsl --install
Advantages:
- Windows integration
- No VM
- Performant
Ubuntu Installation (Example)
Prerequisites
- RAM: Minimum 2GB (4GB recommended)
- Disk: Minimum 20GB (50GB recommended)
- Processor: 64-bit
Installation Steps
-
Download Ubuntu:
- Go to ubuntu.com/download
- Download the LTS version
-
Create a bootable USB drive:
- Use Rufus (Windows) or Balena Etcher
- Burn the ISO to the USB drive
-
Boot from the USB drive:
- Restart the computer
- Access BIOS/UEFI (F2, F12, Del)
- Choose the USB drive as the boot device
-
Install Ubuntu:
- Choose "Install Ubuntu"
- Follow the installation wizard
- Set up user and password
First Login
Graphical Interface
After installation, you will see:
- Desktop: Graphical interface
- Applications Menu: Access to programs
- Terminal: Accessible via Ctrl+Alt+T
Terminal
The terminal is your main interface for Linux:
# Open the terminal
# Ctrl+Alt+T (Ubuntu)
# Or search for "Terminal" in the menu
Typical appearance:
user@hostname:~$
# user: your username
# hostname: machine name
# ~: home directory
# $: command prompt (normal user)
# #: root prompt (superuser)
First Commands
Navigation
# See where you are
pwd
# List files
ls
ls -la # Full details
# Change directory
cd /home
cd ~ # Home directory
cd .. # Parent directory
cd - # Previous directory
Files
# Create a file
touch my_file.txt
# Edit a file
nano my_file.txt
# or
vim my_file.txt
# Display content
cat my_file.txt
less my_file.txt
# Create a directory
mkdir my_directory
# Copy
cp file.txt copy.txt
# Move/Rename
mv file.txt new_name.txt
# Delete
rm file.txt
rm -r directory # Recursive
Help
# Command help
man ls
ls --help
# System information
uname -a
whoami
Initial Configuration
System Update
# Ubuntu/Debian
sudo apt update
sudo apt upgrade
# Red Hat/CentOS
sudo yum update
# or
sudo dnf update
Software Installation
# Ubuntu/Debian
sudo apt install package_name
# Example
sudo apt install vim git curl
Installation Verification
Verification Commands
# Kernel version
uname -r
# Distribution
cat /etc/os-release
# Disk space
df -h
# Memory
free -h
# Processes
ps aux | head
Summary
In this chapter, you learned:
Distributions: Ubuntu, Debian, Red Hat, etc.
Installation: VM (recommended), Dual-boot, WSL
Terminal: Main command line interface
Basic Commands: pwd, ls, cd, mkdir, cp, mv, rm
Update: apt update/upgrade (Ubuntu/Debian)
Verification: uname, df, free, ps
Next Steps
Module 2: Linux System Architecture
Lab 1.1: Linux Installation and First Use
Chapter created on: December 2024