Skip to content

Latest commit

Β 

History

History
305 lines (217 loc) Β· 8.24 KB

File metadata and controls

305 lines (217 loc) Β· 8.24 KB

πŸ’Ώ Chapter 02: Installation & Setup

Beginner Chapter 02


πŸ“‘ Table of Contents


Before You Install

System Requirements (Ubuntu 24.04 LTS)

Component Minimum Recommended
CPU 2 GHz dual-core 4+ cores
RAM 4 GB 8 GB+
Storage 25 GB 50 GB+
Display 1024Γ—768 1920Γ—1080

Download a Linux ISO

Distro Download Link Notes
Ubuntu ubuntu.com/download LTS = Long Term Support (5 years)
Fedora fedoraproject.org Latest desktop tech
Linux Mint linuxmint.com Great for Windows users

πŸ’‘ Tip: Always verify your download with the provided SHA256 checksum to ensure integrity.

# Verify ISO integrity (on Linux/Mac)
sha256sum ubuntu-24.04-desktop-amd64.iso

# On Windows PowerShell
Get-FileHash .\ubuntu-24.04-desktop-amd64.iso -Algorithm SHA256

Method 1: Virtual Machine (Recommended for Beginners)

A Virtual Machine (VM) runs Linux inside your current OS β€” no risk to your existing system.

Using VirtualBox (Free)

Step 1: Install VirtualBox

Step 2: Create a New VM

  1. Click "New"
  2. Name: Ubuntu
  3. Type: Linux, Version: Ubuntu (64-bit)
  4. RAM: 4096 MB (4 GB minimum)
  5. Create a virtual hard disk: VDI, Dynamically allocated, 50 GB

Step 3: Configure the VM

Settings β†’ System β†’ Processor β†’ 2+ CPUs
Settings β†’ Display β†’ Video Memory β†’ 128 MB
Settings β†’ Storage β†’ Controller: IDE β†’ Choose your ISO file

Step 4: Install Linux

  1. Start the VM
  2. Select "Install Ubuntu"
  3. Follow the graphical installer
  4. Choose "Erase disk and install" (this only erases the virtual disk!)
  5. Set your username, password, and timezone
  6. Reboot when prompted

Step 5: Install Guest Additions (for better performance)

# After booting into your new Linux install
sudo apt update
sudo apt install virtualbox-guest-utils virtualbox-guest-x11
sudo reboot

πŸš€ Pro Tip: Enable Shared Clipboard and Drag & Drop in VM Settings β†’ General β†’ Advanced.

Using VMware Workstation Player (Free)

  • Download from vmware.com
  • Steps are similar to VirtualBox
  • VMware often has better performance out of the box

Method 2: WSL (Windows Subsystem for Linux)

WSL lets you run Linux directly on Windows 10/11 β€” no VM needed. Perfect for developers.

Install WSL 2

# Open PowerShell as Administrator and run:
wsl --install

# This installs WSL 2 with Ubuntu by default
# Restart your computer when prompted

After Restart

# Ubuntu will launch automatically
# Set your username and password when prompted

# To install a different distro:
wsl --list --online           # See available distros
wsl --install -d Debian       # Install Debian
wsl --install -d Fedora       # Install Fedora

Useful WSL Commands

wsl --list --verbose          # List installed distros
wsl --set-default Ubuntu      # Set default distro
wsl --shutdown                # Shut down all WSL instances
wsl --update                  # Update WSL kernel

Access Files Between Windows and WSL

# From WSL, access Windows files:
cd /mnt/c/Users/YourName/Desktop

# From Windows, access WSL files:
# Open File Explorer and navigate to:  \\wsl$\Ubuntu\home\username

⚠️ Warning: Do NOT edit WSL Linux files from Windows using Windows tools β€” it can corrupt them. Use code . to open VS Code with WSL support.


Method 3: Dual Boot

Run Linux alongside Windows on the same machine. You choose which to boot at startup.

Prerequisites

  • Back up all important data
  • At least 50 GB of free disk space
  • A USB drive (8 GB+)
  • Disable Secure Boot in BIOS (sometimes needed)
  • Disable Fast Startup in Windows

Step 1: Create a Bootable USB

Using Rufus (Windows):

  1. Download Rufus
  2. Insert USB drive
  3. Select your Linux ISO
  4. Partition scheme: GPT (for UEFI) or MBR (for Legacy BIOS)
  5. Click Start

Using Etcher (Cross-platform):

  1. Download balenaEtcher
  2. Select ISO β†’ Select USB β†’ Flash!

Step 2: Shrink Windows Partition

Windows: Disk Management β†’ Right-click C: β†’ Shrink Volume β†’ Enter 50000 MB (50 GB)

Step 3: Boot from USB

  1. Restart your computer
  2. Press boot menu key during startup:
    • Dell/Lenovo: F12
    • HP: F9
    • ASUS: F8 or Esc
    • Acer: F12
  3. Select your USB drive

Step 4: Install Linux

  1. Choose "Install alongside Windows" (the installer will auto-detect)
  2. Allocate space (50 GB minimum recommended)
  3. The installer will set up GRUB bootloader automatically
  4. On reboot, you'll see a menu to choose Windows or Linux

πŸ›‘οΈ Important: Always install Linux AFTER Windows. Linux's GRUB bootloader will detect Windows, but Windows' bootloader won't detect Linux.


Method 4: Live USB (Try Without Installing)

Boot from USB to try Linux without changing anything on your hard drive.

  1. Create a bootable USB (same as dual boot Step 1)
  2. Boot from USB
  3. Choose "Try Ubuntu" instead of "Install"
  4. Explore! Changes are lost when you shut down.

πŸ’‘ Use Case: Great for testing hardware compatibility, recovering data from a broken system, or just exploring.


Method 5: Cloud Instance

Run Linux on a remote server β€” no local installation needed.

Free Tier Options

Provider Free Offer
AWS 750 hours/month of t2.micro for 12 months
Google Cloud e2-micro instance always free
Oracle Cloud 2 AMD instances always free
DigitalOcean $200 credit for 60 days (with GitHub Student Pack)

Quick Start with AWS

# After creating an AWS account and launching an EC2 instance:
ssh -i "your-key.pem" ubuntu@your-instance-ip

# You now have a full Linux terminal!

Post-Installation Setup

Once you have Linux running, do these first:

1. Update Your System

# Debian/Ubuntu
sudo apt update && sudo apt upgrade -y

# Fedora
sudo dnf update -y

# Arch
sudo pacman -Syu

2. Install Essential Tools

# Ubuntu/Debian
sudo apt install -y curl wget git vim htop net-tools build-essential

# Fedora
sudo dnf install -y curl wget git vim htop net-tools gcc make

3. Set Your Timezone

# Check current timezone
timedatectl

# List available timezones
timedatectl list-timezones

# Set timezone
sudo timedatectl set-timezone Asia/Dhaka

4. Create Your First File

echo "Hello, Linux!" > ~/my-first-file.txt
cat ~/my-first-file.txt
# Output: Hello, Linux!

πŸŽ‰ Congratulations! You now have a working Linux system!


πŸ‹οΈ Practice Exercises

  1. Install Linux using any method above (VM is recommended for beginners)
  2. Update your system using the appropriate package manager
  3. Install htop and run it: htop
  4. Check your kernel version: uname -r
  5. Check your disk space: df -h
  6. Create a file: echo "I'm learning Linux!" > ~/hello.txt

← Previous: Introduction Β· 🏠 Home Β· Next: Terminal Basics β†’