SMirrors 🪞
Automatic mirror list updater for Linux distributions - Keep your package manager mirrors fast and up-to-date with zero effort.
SMirrors intelligently selects the fastest mirrors for your Linux distribution based on real-time download speed and latency tests. Run it once, or set it up as a background service to keep your mirrors optimized 24/7.
✨ Features
- 🚀 Automatic Mirror Optimization - Tests and ranks mirrors by speed and latency
- 🐧 Multi-Distro Support - APT, DNF, Pacman, Zypper and more
- ⏰ Flexible Scheduling - Hourly auto-updates, custom intervals, or manual control
- 📌 Static Mirror Pinning - Preserve critical mirrors (Docker, custom repos)
- 🎨 Beautiful TUI - Interactive terminal interface for easy management
- 🔒 Safe & Reliable - Automatic backups, rollback on failure, validation
- 📊 History Tracking - Monitor performance over time
- ⚡ Fast & Efficient - Parallel testing, minimal resource usage
- 🛡️ Systemd Integration - Run as a background service
📦 Installation
From Binary Release
# Download latest release
|
# Install
From Source
# Clone repository
# Build and install
Post-Installation
# Initialize configuration
# Enable systemd service (optional)
🚀 Quick Start
Test mirrors without updating
Update mirror list now
Launch interactive TUI
Enable automatic updates
📖 Usage
Basic Commands
| Command | Description |
|---|---|
smirrors test |
Test mirrors and show results (no changes) |
smirrors update |
Update mirror list with fastest mirrors |
smirrors list |
Display current mirrors |
smirrors tui |
Launch interactive TUI |
smirrors status |
Show service status and last update |
smirrors history |
View update history |
smirrors rollback |
Restore previous mirror configuration |
Static Mirror Management
# Add static mirror for Docker
# Remove a mirror
# List static mirrors
Configuration
# Edit configuration
# Set update interval
# Enable/disable specific distro handlers
Service Management
# Enable automatic updates
# Disable automatic updates
# Check service status
# View logs
⚙️ Configuration
Configuration file: /etc/smirrors/config.toml or ~/.config/smirrors/config.toml
[]
= "1h" # Auto-update interval
= true # Enable automatic updates
= 10 # Parallel mirror tests
= 10 # Test timeout in seconds
[]
= 0.7 # Weight for download speed (0-1)
= 0.3 # Weight for latency (0-1)
= "1MB" # Size of test download
= 5 # Number of mirrors to include
[]
= true
= "/etc/apt/sources.list"
= "/var/backups/smirrors"
[]
# Pin Docker mirror
= "https://download.docker.com/linux/ubuntu"
[]
= "info" # debug, info, warn, error
= "human" # human, json
= "/var/log/smirrors.log"
[]
= false
= true
= false
🎨 TUI Interface
The TUI provides an interactive interface for:
- Dashboard - Service status, last update, current mirrors
- Test Results - Real-time mirror testing with progress bars
- History - Past updates and performance trends
- Configuration - Edit settings visually
- Static Mirrors - Manage pinned repositories
Keyboard Shortcuts:
q- Quitt- Run testu- Update mirrorsh- Show historyc- Open configurationr- RollbackTab- Switch viewsEnter- Select/ConfirmEsc- Cancel/Back
🐧 Supported Distributions
| Distribution | Package Manager | Status | Config Path |
|---|---|---|---|
| Debian/Ubuntu | APT | ✅ Full Support | /etc/apt/sources.list |
| Fedora/RHEL | DNF | ✅ Full Support | /etc/yum.repos.d/ |
| Arch Linux | Pacman | ✅ Full Support | /etc/pacman.d/mirrorlist |
| openSUSE | Zypper | ✅ Full Support | /etc/zypp/repos.d/ |
| Linux Mint | APT | ✅ Full Support | /etc/apt/sources.list |
| Manjaro | Pacman | ✅ Full Support | /etc/pacman.d/mirrorlist |
🛠️ Development
Prerequisites
- Rust 1.75+ (2024 edition)
- Linux system for testing
sudoaccess for integration tests
Building
# Development build
# Release build
# Run tests
# Run with logging
RUST_LOG=debug
Project Structure
src/core/- Core mirror testing and update logicsrc/distro/- Distribution-specific handlerssrc/tui/- Terminal UI implementationsrc/service/- Background service/daemonsrc/cli/- Command-line interfacetests/- Integration and unit tests
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
🔒 Security
- All mirror list modifications require
sudoprivileges - Automatic backups before any changes
- Validation of mirror URLs and repository signatures
- Rollback capability in case of issues
- Secure HTTPS for mirror testing
Report security vulnerabilities to arygorji.pour@gmail.com
📄 License
This project is licensed under the MIT License - see LICENSE file for details.
🙏 Acknowledgments
- Inspired by
reflector(Arch),apt-select(Debian), anddnf fastest-mirror - Built with amazing Rust crates:
tokio,clap,ratatui,reqwest,serde - Thanks to all Linux mirror maintainers worldwide