Installing Linux
Overview
This chapter introduces how to install the Linux operating system. We will cover multiple installation methods, from the most suitable virtual machine installation for beginners, to dual-boot and full installations.
Pre-Installation Preparation
1. Choose a Distribution
For beginners, the following distributions are recommended:
- Ubuntu: Most popular, good community support, suitable for getting started
- Linux Mint: Based on Ubuntu, offering a more traditional desktop experience
- Fedora: More recent software, suitable for developers
2. Download ISO Image
Download the ISO image file from the official website:
- Ubuntu: https://ubuntu.com/download
- Linux Mint: https://linuxmint.com/download.php
- Fedora: https://getfedora.org/
3. Verify Downloaded Files
After downloading, it's recommended to verify file integrity:
# Calculate SHA256 checksum
sha256sum ubuntu-24.04-desktop-amd64.iso
# Compare with the checksum provided on the official websiteInstallation Method Selection
Method 1: Virtual Machine Installation (Recommended for Beginners)
Advantages:
- Does not affect existing system
- Can create snapshots at any time
- Convenient to try different distributions
Disadvantages:
- Performance has overhead
- Cannot use full hardware resources
Method 2: Dual-Boot Installation
Advantages:
- Can experience the complete Linux
- Retain existing operating system
Disadvantages:
- Installation process is more complex
- Requires reboot to switch systems
Method 3: Full Installation
Advantages:
- Best performance
- Complete Linux experience
Disadvantages:
- Will overwrite existing system
- Need to backup important data
Method 4: WSL (Windows Subsystem for Linux)
Advantages:
- Windows users can quickly experience Linux
- No need to reboot to switch
Disadvantages:
- Not a complete Linux experience
- Some features are limited
Virtual Machine Installation (Detailed Steps)
Installing VirtualBox
Windows Users
- Visit https://www.virtualbox.org/
- Download the Windows installer
- Run the installer and follow the prompts to complete installation
macOS Users
# Install using Homebrew
brew install --cask virtualboxLinux Users
# Debian/Ubuntu
sudo apt install virtualbox
# Fedora
sudo dnf install virtualbox
# Arch Linux
sudo pacman -S virtualboxCreating a Virtual Machine
Open VirtualBox, click "New"
Configure virtual machine name and type
- Name: Ubuntu (or any name)
- Type: Linux
- Version: Ubuntu (64-bit)
Allocate memory
- Recommend at least 2GB (2048 MB)
- If host memory is sufficient, allocate 4GB or more
Create virtual hard disk
- Select "Create a virtual hard disk now"
- Hard disk file type: VDI
- Storage on physical hard disk: Dynamically allocated
- Size: Recommend 25GB or larger
Configure virtual machine settings
- System → Processor: Allocate 2 or more CPU cores
- Display → Video Memory: 128 MB
- Storage → Add ISO image to optical drive
Installing Ubuntu
Start the virtual machine
- Select the virtual machine and click "Start"
Select language
- Select "中文(简体)"
Select installation type
- Click "Install Ubuntu"
Keyboard layout
- Select "Chinese" or "English (US)"
Installation options
- Normal installation (includes common software)
- Check "Download updates while installing"
Installation type
- Select "Erase disk and install Ubuntu"
- (This is safe in a virtual machine)
Timezone settings
- Select Shanghai
Create user
- Enter your name
- Set computer name
- Create username
- Set password
Wait for installation to complete
- Installation usually takes 10-20 minutes
Restart system
- After installation is complete, click "Restart now"
- Remove installation media as prompted
Installing Guest Additions
Installing VirtualBox Guest Additions provides better experience:
# Open terminal in virtual machine and execute:
sudo apt update
sudo apt install build-essential dkms linux-headers-$(uname -r)
# Then in VirtualBox menu select:
# Devices → Install Guest AdditionsDual-Boot Installation
Preparation Work
Backup important data
- This is very important!
Create bootable USB
Use Rufus (Windows) or Etcher (cross-platform):
# Using Etcher 1. Download and install Etcher 2. Select Linux ISO image 3. Select USB drive 4. Click Flash to begin writingMake space for Linux
In Windows:
- Right-click "This PC" → Manage → Disk Management
- Select a partition, right-click "Shrink Volume"
- Allocate at least 50GB space for Linux
Disable Windows Fast Startup
- Control Panel → Power Options → Choose what the power buttons do
- Uncheck "Turn on fast startup"
Installation Steps
Boot from USB
- Restart computer, enter BIOS/UEFI
- Set USB as first boot device
- Or use boot menu (usually F12 or F2)
Select "Install Ubuntu"
Select installation type
- Select "Install Ubuntu alongside Windows Boot Manager"
- Or select "Something else" for manual partitioning
Manual partitioning (optional)
Recommended partitioning scheme:
Partition Size File System Mount Point EFI 512 MB FAT32 /boot/efi Root 30-50 GB ext4 / Swap Equal to RAM swap - Home Remaining space ext4 /home Complete installation
- Follow the installation wizard to complete remaining steps
- After restart, you will see GRUB boot menu
WSL Installation (Windows 10/11)
Enable WSL
# Run PowerShell as administrator
wsl --installInstall Specific Distribution
# View available distributions
wsl --list --online
# Install Ubuntu
wsl --install -d Ubuntu
# Install other distributions
wsl --install -d DebianWSL Basic Configuration
# Set default distribution
wsl --set-default Ubuntu
# View installed distributions
wsl --list --verbose
# Set WSL version
wsl --set-version Ubuntu 2Starting and Using
# Start default distribution
wsl
# Start specific distribution
wsl -d Ubuntu
# Start as root user
wsl -u rootPost-Installation Basic Configuration
1. Update System
# Debian/Ubuntu
sudo apt update && sudo apt upgrade -y
# Fedora
sudo dnf update -y
# Arch Linux
sudo pacman -Syu2. Install Common Software
# Debian/Ubuntu
sudo apt install vim git curl wget htop
# Fedora
sudo dnf install vim git curl wget htop3. Configure Chinese Input Method
# Ubuntu
sudo apt install ibus-pinyin
# Then add Chinese input method in Settings4. Install Graphics Drivers (if needed)
# Ubuntu - NVIDIA drivers
sudo ubuntu-drivers autoinstall
# Or install manually
sudo apt install nvidia-driver-5355. Configure Terminal
# Install Oh My Bash (optional)
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"Common Problem Solutions
1. UEFI Secure Boot Issue
If unable to boot from USB:
- Enter BIOS settings
- Disable Secure Boot
- Or use signed boot loader
2. Partition Issues
If installation program cannot recognize hard drive:
- May need to disable Intel RST
- Change SATA mode to AHCI in BIOS
3. Wireless Adapter Not Working
# View network card information
lspci | grep -i wireless
lsusb | grep -i wireless
# Install additional drivers
sudo apt install linux-firmware4. Time Not Synchronized (Dual-Boot)
# Make Linux use local time
timedatectl set-local-rtc 1 --adjust-system-clockGetting Help
If you encounter problems during installation:
Official Documentation
- Ubuntu: https://help.ubuntu.com/
- Fedora: https://docs.fedoraproject.org/
Community Forums
- Ubuntu Forum: https://ubuntuforums.org/
- Ask Ubuntu: https://askubuntu.com/
Search Engines
- Searching with error messages usually finds solutions
Summary
This chapter introduced multiple ways to install Linux:
- Virtual Machine Installation: Most suitable for beginners, safe and convenient
- Dual-Boot Installation: Can experience complete Linux
- WSL: Convenient choice for Windows users
Recommend beginners first use a virtual machine to become familiar with Linux, then consider dual-boot or full installation.
Previous chapter: Linux Introduction
Next chapter: Desktop Environment