Chapter 10: Action Plan — Setting Up a New Linux Machine


This chapter brings everything together as a practical checklist for setting up a fresh Linux installation. Follow the phases in order for a development-ready machine, or jump to the relevant section for a quick reference.


Phase 1: Update the System

Before installing anything else, bring the system fully up to date:

sudo apt update && sudo apt upgrade -y
sudo apt autoremove -y
sudo reboot

On Fedora/RHEL:

sudo dnf upgrade -y
sudo reboot

Phase 2: Set Up SSH Keys

# Generate an Ed25519 key
ssh-keygen -t ed25519 -C "your_email@example.com"

# Start the SSH agent and add your key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

# Print your public key — copy this to GitHub/GitLab
cat ~/.ssh/id_ed25519.pub

# Test the connection
ssh -T git@github.com

Then create ~/.ssh/config with your host aliases (see Chapter 1).


Phase 3: Install Core Development Tools

# Essential build tools and utilities
sudo apt install -y \
  git curl wget vim htop btop \
  build-essential \
  python3 python3-pip python3-venv \
  ripgrep \
  tmux \
  unzip

# See code/first-time-setup.sh for a more complete list

Configure git with your identity:

git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"
git config --global init.defaultBranch main

Phase 4: Install Desktop Applications

For GUI apps, prefer Flatpak (via Flathub) for better sandboxing and broader selection, or Snap for Ubuntu-centric tools.

# Set up Flatpak + Flathub (do this once)
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

# Example desktop apps via Flatpak
flatpak install flathub org.gimp.GIMP
flatpak install flathub com.spotify.Client
flatpak install flathub org.videolan.VLC

# Example apps via Snap
sudo snap install code --classic        # VS Code
sudo snap install discord

Phase 5: Handle AppImages and Custom Packages

For apps distributed as AppImages:

mkdir -p ~/Applications
mv ~/Downloads/MyApp-*.AppImage ~/Applications/
chmod +x ~/Applications/MyApp-*.AppImage
sudo apt install libfuse2               # if needed

Run code/install-appimage.sh to integrate an AppImage with your desktop launcher.

For .deb files (VS Code, Chrome, etc.):

sudo apt install ./downloaded-package.deb

Phase 6: Configure Your Shell Environment

# Install zsh and Oh My Zsh (optional but popular)
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Or enhance bash with useful aliases in ~/.bashrc
echo 'alias ll="ls -alF"' >> ~/.bashrc
echo 'alias gs="git status"' >> ~/.bashrc
source ~/.bashrc

Compression Cheat Sheet

Task Command
Create .tar.gz tar -czf archive.tar.gz dir/
Create .tar.xz tar -cJf archive.tar.xz dir/
Create .zip zip -r archive.zip dir/
Extract any tar tar -xf archive.tar.gz
Extract .zip unzip archive.zip
Extract to dir tar -xzf archive.tar.gz -C /target/
List without extracting tar -tzf archive.tar.gz
Compress a file gzip -k file.txt (keeps original)

Package Manager Command Comparison

Task apt dnf snap flatpak
Search apt search kw dnf search kw snap find kw flatpak search kw
Install apt install pkg dnf install pkg snap install pkg flatpak install hub id
Remove apt remove pkg dnf remove pkg snap remove pkg flatpak uninstall id
Update all apt upgrade dnf upgrade snap refresh flatpak update
List installed apt list --installed dnf list installed snap list flatpak list
Show info apt show pkg dnf info pkg snap info pkg flatpak info id

Getting Help

Every command has a manual page:

man tar                                # full manual
man ssh                                # SSH manual
man 5 ssh_config                       # section 5: config file format

For a shorter, practical summary, install tldr:

sudo apt install tldr
tldr tar                               # practical examples for tar
tldr ssh                               # practical SSH examples

The Arch Wiki (wiki.archlinux.org) is the best comprehensive Linux reference, even if you do not use Arch. Its articles on topics like systemd, SSH, and package management are authoritative and distribution-agnostic at the conceptual level.


What to Explore Next


← Chapter 9: Process and System Monitoring Table of Contents