Skip to content

MeSoheili/relix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReLix

⚑ ReLix

A production-grade, flicker-free TUI for managing APT repositories on Debian & Ubuntu

C++17 CMake License: MIT Platform: Linux ncurses PRs Welcome


ReLix is a fast, keyboard-driven terminal UI for managing APT software repositories on Debian and Ubuntu systems. It replaces hand-editing /etc/apt/sources.list and scattered .list / .sources files with a safe, structured interface β€” complete with atomic writes, automatic backups, undo, live search, async metadata fetch, and four color themes.

No GUI required. No Python runtime. A single self-contained C++17 binary.


πŸ“Έ Preview

╔══════════════════════════════════════════════════════════════════════════════════════╗
β•‘  ReLix  |  OS: ubuntu 24.04  |  Theme: Dark  |  Sort: File          [ROOT]     β•‘
╠══════════════════════════════════════════════════╦═════════════════════════════════╣
β•‘ ● deb http://archive.ubuntu.com/ubuntu noble ... β•‘ Status:      ENABLED            β•‘
β•‘ ● deb http://archive.ubuntu.com/ubuntu noble ... β•‘ Format:      deb822 (.sources)  β•‘
β•‘ β—‹ # deb http://dl.google.com/linux/chrome/deb  β•‘ Type:        deb                β•‘
β•‘ ● deb https://download.docker.com/linux/ubuntu  β•‘ URI:         https://download.. β•‘
β•‘ ● deb https://packages.microsoft.com/repos/code β•‘ Suite:       noble              β•‘
β•‘                                                  β•‘ Comps:       stable             β•‘
β•‘                                                  β•‘ File:        /etc/apt/sources.. β•‘
β•‘                                                  ╠═════════════════════════════════╣
β•‘                                                  β•‘ Origin:      Docker             β•‘
β•‘                                                  β•‘ Codename:    noble              β•‘
β•‘                                                  β•‘ Updated:     2025-06-01 14:32  β•‘
β•‘                                                  β•‘ Reachable:   Yes                β•‘
╠══════════════════════════════════════════════════╩═════════════════════════════════╣
β•‘ [5/5]  Repository toggled.                                                         β•‘
β•‘ F2:Toggle F3:Add F4:Del F5:Update F6:Reload F7:Backup F8:Export m:Meta t:Theme q  β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

✨ Features

πŸ–₯️ Interface

  • Two-pane layout β€” repository list (60%) + live detail view (40%)
  • Flicker-free rendering β€” erase() + wnoutrefresh() + doupdate() for single atomic terminal write per frame
  • Mouse support β€” click to select, double-click to toggle, scroll wheel navigation
  • 4 color themes β€” Dark, Light, Solarized, Monokai (press t to cycle, persisted to config)
  • Live search β€” press / to filter repositories in real-time, case-insensitive
  • 3 sort modes β€” by file, by status (enabled first), or alphabetical (press s)
  • Scrollbar indicator β€” visual position indicator in list pane
  • apt update output pager β€” color-coded Hit/Get/Err lines in a scrollable ncurses popup

πŸ”’ Safety

  • Atomic writes β€” all file edits go through .tmp β†’ rename() (POSIX atomic, never corrupts on crash)
  • Automatic backup β€” every write creates a timestamped .bak in /var/backups/ReLix/ first
  • Undo stack β€” up to 20 levels of undo (Ctrl+Z), per-file
  • Read-only mode β€” runs safely without root, all write actions are blocked with clear messaging
  • Root privilege check at startup with [READ-ONLY] badge in header

πŸ“¦ APT Format Support

  • Legacy one-line format (.list) β€” full enable/disable/delete/add
  • deb822 format (.sources) β€” block-aware parsing for Ubuntu 22.04+ and Debian 12+
  • Automatic format detection based on OS version from /etc/os-release
  • Handles # deb, #deb, and deb comment styles correctly

🌐 Repository Metadata

  • Async fetch with 3 s timeout β€” non-blocking DNS + TCP reachability check
  • Local cache parsing β€” reads /var/lib/apt/lists/ Release files for Origin, Codename, Suite, Version, Date, Description
  • Last-updated timestamp from apt cache file mtime

βš™οΈ Management

  • Export all repositories to a portable text file
  • Import from a text file with automatic deduplication
  • Config persistence β€” theme, sort mode, backup directory saved to ~/.config/ReLix/config

πŸš€ Quick Start

# 1. Clone
git clone https://github.com/yourusername/ReLix.git
cd ReLix

# 2. Install dependencies (Debian/Ubuntu)
sudo apt install cmake build-essential libncursesw5-dev

# 3. Build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build/ -j$(nproc)

# 4. Run (root required for editing; read-only without)
sudo ./build/ReLix

πŸ“‹ Requirements

Requirement Minimum Notes
OS Debian 10 / Ubuntu 20.04 Any apt-based Linux
Compiler GCC 9+ or Clang 10+ C++17 required
CMake 3.16+
ncurses libncursesw5-dev Wide-char preferred
Terminal 80Γ—24 minimum 120Γ—40+ recommended

⌨️ Keyboard Reference

Key Action
↑ / ↓ Navigate repository list
PgUp / PgDn Scroll by 10 entries
Home / End Jump to first / last
F2 Toggle repository enabled/disabled
F3 Add new repository
F4 Delete selected repository
F5 Run sudo apt update (output captured in pager)
F6 Reload all repository files from disk
F7 Manual backup of selected file
F8 Export / Import repository list
m Fetch repository metadata (async, 3 s timeout)
t Cycle color theme (Dark β†’ Light β†’ Solarized β†’ Monokai)
s Cycle sort mode (File β†’ Status β†’ Alphabetical)
/ Enter live search/filter mode
Esc Clear search filter
Ctrl+Z Undo last file change
q / F10 Quit and save config
Mouse Click = select, Double-click = toggle, Scroll = navigate

πŸ—‚οΈ Repository Structure

ReLix/
β”œβ”€β”€ main.cpp          # Full application (~1,580 lines, 21 sections)
β”œβ”€β”€ CMakeLists.txt    # Build system with hardening flags
β”œβ”€β”€ README.md
β”œβ”€β”€ TECHNICAL_GUIDE.md
└── LICENSE

πŸ—οΈ Build Options

# Release (default) β€” optimised + hardened
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build/ -j$(nproc)

# Debug β€” AddressSanitizer + UBSan enabled automatically
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build/

# Install to /usr/local/bin
sudo cmake --install build/

# Uninstall
sudo cmake --build build/ --target uninstall

πŸ”§ Configuration

ReLix stores preferences in ~/.config/ReLix/config:

theme=0            # 0=Dark 1=Light 2=Solarized 3=Monokai
sort=0             # 0=File 1=Status 2=Alphabetical
backup_dir=/var/backups/ReLix
confirmToggle=0    # 1 = ask before every toggle

πŸ›‘οΈ Safety Model

Every destructive operation follows this sequence:

1. Read file β†’ memory
2. Push current state onto undo stack (up to 20 levels)
3. Create timestamped backup in backup_dir
4. Write changes to <file>.ReLix.tmp
5. rename() tmp β†’ original   ← POSIX atomic, crash-safe
6. Reload UI from disk

No partial writes ever reach your APT source files.


🀝 Contributing

Pull requests are welcome. For significant changes please open an issue first.

# Development build with sanitisers
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build/
sudo ./build/ReLix

Please maintain the existing code style: single-file C++17, static file-scope functions, section comments, no external dependencies beyond ncurses and pthreads.


πŸ“œ License

MIT Β© 2025 β€” see LICENSE for details.


ReLix β€” manage APT repositories without fear.

Keywords: apt repository manager, debian repository tool, ubuntu sources.list editor, ncurses tui, deb822, apt sources manager, terminal ui, linux package management

About

A production-grade, TUI for managing APT repositories on Debian & Ubuntu

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors