Pop!_OS Optimization Toolkit


Overview
The Pop!_OS Optimization Toolkit is an interactive, terminal-based installer that automatically detects your hardware — CPU, GPU, RAM, laptop model, battery — and delivers tailored configuration for six distinct workload modules: Developer Tools, AI/ML Workstation, Gaming, Robotics (ROS 2), SSH, and System Optimization.
Instead of hunting through dozens of blog posts and wikis, you run one script. It probes your machine, recommends what to install, and lets you toggle individual packages on or off through a polished TUI checklist — nothing is installed without your explicit confirmation.
The entire toolkit is written in pure Bash with zero external dependencies beyond standard coreutils. It accounts for Pop!_OS-specific differences (systemd-boot, kernelstub, system76-power, COSMIC desktop) that break most Ubuntu guides.
Architecture
The project follows a clean modular architecture: a shared library provides all TUI rendering, hardware detection, and installation helpers, while each module script is self-contained and can be run independently or orchestrated through the master installer.
install.sh ← Interactive entry point (CLI + menu)
│
├── lib/common.sh ← Shared TUI library (700 lines)
│ ├── ANSI Color Palette (Pop!_OS brand-inspired)
│ ├── Box Drawing & Layout (Unicode box-drawing characters)
│ ├── Hardware Detection (CPU, GPU, RAM, VRAM, battery, thermals)
│ ├── GPU Tier Classification (ultra / high / medium / entry / minimal)
│ ├── Interactive Menus (numbered select + toggle checklist)
│ ├── Progress Indicators (spinner, progress bar)
│ ├── Installation Helpers (apt, pip, flatpak, snap — all DRY_RUN aware)
│ └── Logging (timestamped file + colored terminal output)
│
└── scripts/
├── dev-setup.sh ← Developer Tools (12 package groups)
├── ai-setup.sh ← AI/ML Workstation (8 package groups)
├── gaming-setup.sh ← Gaming Optimization (10 package groups)
├── robotics-setup.sh ← Robotics Lab / ROS 2 (10 package groups)
├── ssh-setup.sh ← SSH Configuration (7 package groups)
└── system-optimize.sh ← System Performance (10 package groups)
Hardware Detection Engine
On launch, the toolkit probes the system and builds a complete hardware profile that drives every downstream decision:
- Machine Identity — reads DMI data (
/sys/devices/virtual/dmi/id/) to identify manufacturer, model, and form factor (laptop vs desktop). - CPU Detection — parses
/proc/cpuinfofor model name, core count, and thread count. Intel hybrid architectures (P-cores + E-cores) are recognized for power tuning. - GPU & VRAM — queries
lspciandnvidia-smifor GPU model, driver version, CUDA version, and total VRAM. VRAM is classified into tiers (ultra ≥ 24 GB, high ≥ 16 GB, medium ≥ 8 GB, entry ≥ 4 GB, minimal). - Contextual Recommendations — the GPU tier feeds directly into AI model recommendations (e.g., entry-tier GPUs get quantized 3B–7B models, ultra-tier gets 70B+ models).
TUI System
The terminal UI is built from scratch using ANSI escape codes and Unicode box-drawing characters. Key components:
- System Banner — a bordered profile card showing machine, OS, kernel, CPU, GPU, RAM, storage, and battery.
- Toggle Checklist — each module presents a checklist where items can be toggled on/off individually, selected all, or deselected all before confirming.
- Progress Tracking — a Unicode block progress bar (
█░) and a braille-character spinner for long-running operations. - DRY_RUN Mode — every installation function respects
--dry-run, logging what would happen without touching the system.
Modules
1. Developer Tools
A comprehensive development environment with 12 selectable package groups:
| Group | Packages |
|---|---|
| Core Build Tools | gcc, make, cmake, pkg-config, autoconf |
| Git & Version Control | git, git-lfs, gh CLI |
| Python Development | python3, pip, venv, dev headers |
| Node.js & npm | NodeSource LTS |
| Rust Toolchain | rustup, cargo, rustc |
| Go Language | Official PPA |
| Docker & Compose | Docker Engine + Compose plugin + user group |
| Terminal Utilities | tmux, htop, btop, neovim, ripgrep, fzf, bat |
| GUI Editors | VS Code (Flatpak or apt) |
| Database Tools | PostgreSQL client, SQLite, Redis |
| Python Data Science | numpy, pandas, matplotlib, jupyter |
| CustomTkinter Stack | customtkinter, pillow, ttkbootstrap |
Each installer detects existing tools first — if docker is already present, it skips reinstallation and shows the current version.
2. AI / ML Workstation
Turns the machine into a local AI inference station with GPU-aware model recommendations.
| Group | What It Does |
|---|---|
| NVIDIA Drivers & CUDA | system76-driver-nvidia, nvidia-cuda-toolkit, nvtop |
| Ollama | Local LLM engine via llama.cpp backend |
| Open WebUI | Docker-based ChatGPT-style interface on localhost:3000 |
| Python ML Stack | PyTorch (CUDA or CPU auto-detected), Hugging Face, bitsandbytes |
| Jupyter Lab | Notebook environment with dedicated ML kernel |
| Computer Vision | OpenCV, Ultralytics YOLO |
| LangChain & RAG | langchain, chromadb, sentence-transformers |
| Text Gen WebUI | oobabooga/text-generation-webui |
After Ollama installation, the toolkit displays a GPU-tier-aware recommendation table showing which models fit in your VRAM — from TinyLlama 1.1B for entry-tier GPUs to Llama 3.1 70B for ultra-tier cards.
3. Gaming Optimization
Configures native Linux gaming, Steam/Proton, performance overlays, and advanced GPU passthrough.
| Group | What It Does |
|---|---|
| Steam | Client via apt with i386 architecture |
| Heroic Launcher | Epic Games / GOG on Linux (Flatpak) |
| Lutris | Universal gaming platform with Wine management |
| GameMode | CPU/GPU game-time optimization daemon |
| MangoHud | FPS overlay with auto-generated config |
| Vulkan & Mesa | 32-bit Vulkan runtime, validation layers |
| ProtonUp-Qt | Custom Proton/GE-Proton version manager |
| Wine & Dependencies | Wine staging + winetricks |
| GPU Passthrough (KVM) | QEMU/KVM + IOMMU via kernelstub (Pop!_OS specific) |
| Controller Support | Xbox, PS4/PS5, Steam controller drivers |
The GPU passthrough module is Pop!_OS-aware: it uses kernelstub (not GRUB) for boot parameters, auto-detects Intel vs AMD for the correct IOMMU flag, and verifies IOMMU groups via dmesg.
4. Robotics Lab (ROS 2)
A full ROS 2 Humble Hawksbill environment with 10 selectable component groups:
| Group | Packages |
|---|---|
| ROS 2 Humble Desktop | Full desktop install + rosdep init |
| Navigation 2 Stack | Nav2, SLAM Toolbox, Cartographer, robot_localization |
| Gazebo Simulation | Gazebo Classic + ROS 2 integration + ros2_control |
| TurtleBot3 | Simulation & real robot support with SLAM demo |
| MoveIt 2 | Robotic arm motion planning framework |
| Arduino / Embedded | Arduino CLI, PlatformIO, pyserial, dialout group |
| Computer Vision (ROS) | cv_bridge, image_transport, depth processing |
| ROS 2 Dev Tools | colcon, rosdep, vcstool, bloom |
| Micro-ROS | ROS 2 for microcontrollers (ESP32, STM32, Pico) |
| RViz Plugins | Visualization tools, rqt, PlotJuggler |
The script automatically adds ROS 2 sourcing and colcon autocomplete to ~/.bashrc, sets up a ~/ros2_ws workspace, and configures the TurtleBot3 default model.
5. SSH Configuration
Interactive SSH key management and server hardening:
| Group | What It Does |
|---|---|
| Key Generation | Ed25519 / RSA 4096 / ECDSA 521 with email prompts |
| SSH Agent | keychain or fallback ssh-agent auto-start |
| GitHub SSH | Public key display, clipboard copy, gh CLI integration, connection test |
| GitLab SSH | Public key display, config setup, connection test |
| SSH Client Config | Host aliases, identity file mapping |
| SSH Server (sshd) | OpenSSH server install + hardening |
| Fail2Ban | Brute-force protection for sshd |
Existing keys are detected and backed up automatically before regeneration. The GitHub module integrates with gh ssh-key add for zero-copy key upload.
6. System Optimization
Low-level performance tuning purpose-built for Pop!_OS:
| Group | What It Does |
|---|---|
| Power Profiles | system76-power (Performance / Balanced / Battery) + auto-cpufreq |
| Thermal Management | lm-sensors, thermald (Intel), live temperature readout |
| SSD Optimization | Weekly TRIM timer, NVMe health via smartctl, I/O scheduler check |
| zRAM Swap | Compressed RAM swap (zstd algo, 50% of RAM) |
| Swappiness Tuning | Configurable vm.swappiness (default: 10 for workstations) + vfs_cache_pressure |
| NVIDIA GPU Optimization | Persistence mode, systemd service, power state monitoring |
| Kernel Boot Parameters | Performance-oriented defaults via kernelstub |
| Network Optimization | DNS, MTU, TCP tuning |
| System Monitoring | btop, nvtop, iotop, nethogs |
| Cleanup & Maintenance | Unused package removal, cache purge |
Key Features
Hardware-Aware Intelligence
Every recommendation adapts to your specific machine. A laptop with an RTX A1000 (6 GB) gets different AI model suggestions than a desktop with an RTX 4090 (24 GB). Battery-equipped machines get power management profiles. Intel hybrid CPUs get auto-cpufreq for P-core/E-core scheduling.
Interactive Checklist UI
No all-or-nothing installs. Each module presents a toggle checklist rendered with Unicode box-drawing characters. Select exactly what you need, confirm, and watch a progress bar track each group.
DRY_RUN Mode
Run ./install.sh --dry-run to preview every apt install, pip install, and flatpak install that would execute — without touching your system. Every installation helper function checks the DRY_RUN flag.
Pop!_OS Native
The toolkit understands Pop!_OS internals that differ from Ubuntu:
| Concern | Pop!_OS Approach |
|---|---|
| Boot parameters | kernelstub -a "param" (not update-grub) |
| Power management | system76-power (not TLP) |
| NVIDIA drivers | Pre-installed via NVIDIA ISO |
| Desktop | COSMIC (GNOME fork) |
| Recovery | Built-in refresh/reinstall partition |
CLI + Interactive Dual Modes
Run interactively with the full TUI menu, or script it via CLI flags:
./install.sh # Interactive menu
./install.sh --dev --ai # Non-interactive: specific modules
./install.sh --all # Non-interactive: everything
./install.sh --dry-run --all # Preview everythingFull Logging
Every operation is timestamped and written to /tmp/pop-os-toolkit-YYYYMMDD-HHMMSS.log. Terminal output is color-coded: [INFO] cyan, [OK] green, [WARN] yellow, [FAIL] red.
Reference Hardware
Developed and tested on a Lenovo ThinkPad P-Series workstation laptop:
| Component | Specification |
|---|---|
| CPU | Intel Core i9-13950HX — 24 cores (8P + 16E), 32 threads, 5.4 GHz |
| GPU | NVIDIA RTX A1000 6 GB — Ampere, CUDA 8.6, ISV-certified |
| RAM | 32 GB DDR5 (dual-channel) |
| Storage | 1 TB NVMe SSD (PCIe Gen4) |
| OS | Pop!_OS 22.04 LTS (NVIDIA ISO) |
Hardware detection adapts automatically for other machines — the toolkit has been designed with manufacturer-specific greetings for Lenovo, Dell, HP, System76, ASUS, Acer, and MSI systems.
Tech Stack
| Layer | Technology |
|---|---|
| Language | Bash 5.x (POSIX-compliant where possible) |
| Target OS | Pop!_OS 22.04 LTS (Ubuntu 22.04 Jammy base) |
| TUI Rendering | ANSI escape codes + Unicode box-drawing |
| Package Managers | apt, pip, flatpak, snap, cargo, rustup |
| Containerization | Docker Engine + Compose |
| AI Inference | Ollama (llama.cpp), PyTorch, CUDA |
| Robotics | ROS 2 Humble, Gazebo, Nav2, MoveIt 2 |
| GPU Stack | NVIDIA drivers, CUDA Toolkit, Vulkan |
| Version Control | Git, GitHub CLI |
Project Structure
pop-os-linux-optimisation/
├── install.sh # Master interactive installer (entry point)
├── lib/
│ └── common.sh # Shared TUI library — colors, menus, hardware detection
├── scripts/
│ ├── dev-setup.sh # Developer tools (12 groups, 310 lines)
│ ├── ai-setup.sh # AI/ML workstation (8 groups, 434 lines)
│ ├── gaming-setup.sh # Gaming optimization (10 groups, 429 lines)
│ ├── robotics-setup.sh # Robotics lab / ROS 2 (10 groups, 428 lines)
│ ├── ssh-setup.sh # SSH configuration (7 groups, 680 lines)
│ └── system-optimize.sh # System performance (10 groups, 558 lines)
├── ai/
│ └── README.md # AI/ML workstation deep-dive guide
├── gaming/
│ └── README.md # Gaming optimization deep-dive guide
├── robotics/
│ └── README.md # ROS 2 robotics deep-dive guide
└── dev-tools/
└── dev-setup.sh # Legacy script (superseded by scripts/)